Наследование: MonoBehaviour
Пример #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     Initialization initialize = new Initialization();
     Tokens scannInputCode = new Tokens();
     dataGridView1.Rows.Clear();
     dataGridView1.Refresh();
     scannInputCode.scan(richTextBox1.Text, initialize.getReservedKeyWords(), initialize.getSpecialSymbols(), this);
 }
		// Start is the function which is run automatically at the start of our program, will be used to
		// instantiate our game objects once we have retrieved and ordered our data. 
		void Start ()
		{	
				//Provide a reference for the starting time of the program.
				startTime = Time.time;
				
				// Creates instances for other classes to be called on during initialization
				initializer = new Initialization ();
				movementClass = new Movement_Related_Functions (numberOfPedestrians, numberOfSteps, positions, 
		                                             	prefabBlue, prefabRed, rotationSpeed, pedestrians);
		}
Пример #3
0
 public static int Main(string[] args)
 {
     return(Initialization.BuildAndRun <Startup>("UserManagement", args));
 }
Пример #4
0
        public static bool UpdateAll(string sectionName, bool isTestEnviroment)
        {
            try
            {
                Initialization.SetServices();
                Provider.SetSectionName(sectionName);
                var connectionString = ConfigurationManager.ConnectionStrings[sectionName].ConnectionString;
                DatabaseService.SetConnectionString(connectionString);
                var provider = Provider.Current();
                provider.Configuration();

                var count = provider.InitializeDb(connectionString);

                bool adminCreated;
                using (var accountDbContext = AccountDbContext.CreateFromConnectionString(connectionString))
                {
                    // обновляем справочники
                    var registrator = new AccountDbDataRegistator(accountDbContext);
                    registrator.RegisterAll();

                    // Проверим, создан ли админ
                    adminCreated = accountDbContext.GetUserRepository().QueryAll().FirstOrDefault(x => x.Roles.Any(y => y.RoleId == RoleId.AccountAdministrators)) != null;
                }

                if (count == 0)
                {
                    _logger.Info("База не изменилась");
                }
                else
                {
                    _logger.Info("База обновлена, установлено миграций: " + count);
                }

                if (adminCreated)
                {
                    _logger.Info("Администратор аккаунта уже создан");
                }
                else
                {
                    var accountInfo = ConfigDbServicesHelper.GetAccountService().GetSystemAccount();

                    using (var context = DispatcherContext.Create())
                    {
                        // создаем root компонент
                        var componentService = context.ComponentService;
                        componentService.CreateRoot(accountInfo.Id, accountInfo.RootId);

                        // создаем админа
                        Console.Write("Укажите EMail администратора: ");
                        var adminEMail = Console.ReadLine();

                        Console.Write("Укажите пароль администратора: ");
                        var adminPassword = Console.ReadLine();

                        var userService = context.UserService;

                        var adminUser = userService.CreateAccountAdmin(
                            accountInfo.Id,
                            adminEMail,
                            null, null, null, null, null);

                        // Установим пароль админа
                        var passwordToken = userService.StartResetPassword(adminUser.Id, false);
                        userService.EndResetPassword(accountInfo.Id, passwordToken, adminPassword);
                        context.SaveChanges();

                        _logger.Info($"Создан пользователь {adminEMail} с паролем {adminPassword}");
                    }

                    // Установим бесконечные лимиты аккаунта
                    var limits = SystemTariffLimits.BaseUnlimited;

                    using (var accountDbContext = AccountDbContext.CreateFromConnectionString(connectionString))
                    {
                        var accountTariffRepository = accountDbContext.GetAccountTariffRepository();
                        var tariffLimitRepository   = accountDbContext.GetTariffLimitRepository();

                        var tariff = new TariffLimit()
                        {
                            Type   = TariffLimitType.Soft,
                            Source = TariffLimitSource.Base,
                            Name   = "Soft",
                            EventsRequestsPerDay     = limits.EventRequestsPerDay,
                            EventsMaxDays            = limits.EventsMaxDays,
                            LogMaxDays               = limits.LogMaxDays,
                            LogSizePerDay            = limits.LogSizePerDay,
                            ComponentsMax            = limits.ComponentsMax,
                            ComponentTypesMax        = limits.ComponentTypesMax,
                            UnitTestTypesMax         = limits.UnitTestTypesMax,
                            HttpUnitTestsMaxNoBanner = limits.HttpChecksMaxNoBanner,
                            UnitTestsMax             = limits.UnitTestsMax,
                            UnitTestsRequestsPerDay  = limits.UnitTestsRequestsPerDay,
                            UnitTestsMaxDays         = limits.UnitTestsMaxDays,
                            MetricsMax               = limits.MetricsMax,
                            MetricsRequestsPerDay    = limits.MetricRequestsPerDay,
                            MetricsMaxDays           = limits.MetricsMaxDays,
                            StorageSizeMax           = limits.StorageSizeMax,
                            SmsPerDay = limits.SmsPerDay,
                        };

                        tariffLimitRepository.Add(tariff);

                        var accountTariff = new AccountTariff()
                        {
                            TariffLimit = tariff
                        };
                        accountTariffRepository.Add(accountTariff);

                        tariff = new TariffLimit()
                        {
                            Type   = TariffLimitType.Hard,
                            Source = TariffLimitSource.Base,
                            Name   = "Hard",
                            EventsRequestsPerDay     = limits.EventRequestsPerDay,
                            EventsMaxDays            = limits.EventsMaxDays,
                            LogMaxDays               = limits.LogMaxDays,
                            LogSizePerDay            = limits.LogSizePerDay,
                            ComponentsMax            = limits.ComponentsMax,
                            ComponentTypesMax        = limits.ComponentTypesMax,
                            UnitTestTypesMax         = limits.UnitTestTypesMax,
                            HttpUnitTestsMaxNoBanner = limits.HttpChecksMaxNoBanner,
                            UnitTestsMax             = limits.UnitTestsMax,
                            UnitTestsRequestsPerDay  = limits.UnitTestsRequestsPerDay,
                            UnitTestsMaxDays         = limits.UnitTestsMaxDays,
                            MetricsMax               = limits.MetricsMax,
                            MetricsRequestsPerDay    = limits.MetricRequestsPerDay,
                            MetricsMaxDays           = limits.MetricsMaxDays,
                            StorageSizeMax           = limits.StorageSizeMax,
                            SmsPerDay = limits.SmsPerDay,
                        };

                        tariffLimitRepository.Add(tariff);

                        accountTariff = new AccountTariff()
                        {
                            TariffLimit = tariff
                        };
                        accountTariffRepository.Add(accountTariff);

                        accountDbContext.SaveChanges();
                    }
                }

                _logger.Info("База успешно обновлена");

                return(true);
            }
            catch (Exception exception)
            {
                _logger.Fatal(exception);
                return(false);
            }
        }
Пример #5
0
 public Requires(bool expression)
 {
     value             = expression;
     initializationWay = Initialization.BoolExpression;
 }
Пример #6
0
 void OnEnable()
 {
     tar = (Initialization)target;
 }
Пример #7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="inputWidth"></param>
        /// <param name="inputHeight"></param>
        /// <param name="inputDepth"></param>
        /// <param name="batchSize"></param>
        /// <param name="initializtion"></param>
        /// <param name="random"></param>

        public void Initialize(int inputWidth, int inputHeight, int inputDepth, int batchSize, Initialization initializtion, Random random)
        {
            var fans         = WeightInitialization.GetFans(this, inputWidth, inputHeight, inputDepth);
            var distribution = WeightInitialization.GetWeightDistribution(initializtion, fans, random);

            Weights = Matrix <float> .Build.Random(fans.FanIn, fans.FanOut, distribution);

            Bias = Vector <float> .Build.Dense(fans.FanOut, 0.0f);

            WeightsGradients = Matrix <float> .Build.Dense(fans.FanIn, fans.FanOut);

            BiasGradients = Vector <float> .Build.Dense(fans.FanOut);

            OutputActivations = Matrix <float> .Build.Dense(batchSize, fans.FanOut);

            m_delta = Matrix <float> .Build.Dense(batchSize, fans.FanIn);
        }
Пример #8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="inputWidth"></param>
        /// <param name="inputHeight"></param>
        /// <param name="inputDepth"></param>
        /// <param name="batchSize"></param>
        /// <param name="initializtion"></param>
        /// <param name="random"></param>

        public void Initialize(int inputWidth, int inputHeight, int inputDepth, int batchSize, Initialization initializtion, Random random)
        {
            // input layer does not have anything to initialize.
        }
Пример #9
0
 public static int Main(string[] args)
 {
     // while(!System.Diagnostics.Debugger.IsAttached)
     //     System.Threading.Thread.Sleep(19);
     return(Initialization.BuildAndRun <Startup>("UserManagement", args));
 }
Пример #10
0
        public kMeans(DistanceMeasure dMeasure,Initialization initialization,bool hierarchical=false)
		{
            this.dMeasure = dMeasure;
            this.initialization = initialization;
            this.hierarchical = hierarchical;
		}
Пример #11
0
 public static List <Bookings> LoadReservationList()
 {
     list_result = Initialization.LoadBookingList(CustFname, CustLname, DOB, Insurance, Vname, FromDate, ToDate, Total_Days, Convert.ToDateTime(FromTime.ToString("HH:mm")), Convert.ToDateTime(ToTime.ToString("HH:mm")), RentalDate, VID, PickUp, DropOff);
     return(list_result);
 }
        static void Main(string[] args)
        {
            String email      = "YOUR_EMAIL";                                   // authorization email
            String licenseKey = "LICENSE_KEY";                                  // license key

            String resourcesDir = Utils.GetAbsolutePath("..\\..\\resources\\"); // resources folder path
            String outputDir    = Utils.GetAbsolutePath("..\\..\\output\\");    // output folder path

            String openPath   = resourcesDir + "test.pdf";                      // source PDF document
            String configPath = resourcesDir + "config.json";                   // configuration file

            try
            {
                System.IO.Directory.CreateDirectory(outputDir);

                Console.WriteLine("Initialization Sample");
                Initialization.Run(email, licenseKey);

                Console.WriteLine("AddComment Sample");
                AddComment.Run(email, licenseKey, openPath,
                               outputDir + "AddComment.pdf");

                Console.WriteLine("AddTags Sample");
                AddTags.Run(email, licenseKey, openPath,
                            outputDir + "AddTags.pdf",
                            configPath);

                Console.WriteLine("AddWatermark Sample");
                AddWatermark.Run(email, licenseKey, openPath,
                                 outputDir + "AddWatermark.pdf",
                                 resourcesDir + "watermark.png",
                                 new PdfWatermarkParams());

                Console.WriteLine("ConvertToHtml Sample");
                ConvertToHtml.Run(email, licenseKey, openPath,
                                  outputDir + "index.html",
                                  configPath,
                                  new PdfHtmlParams());

                ConvertToHtmlByPages.Run(email, licenseKey, openPath,
                                         outputDir + "",
                                         configPath,
                                         new PdfHtmlParams());

                Console.WriteLine("DigitalSignature Sample");
                DigitalSignature.Run(email, licenseKey, openPath,
                                     outputDir + "DigitalSignature.pdf",
                                     resourcesDir + "test.pfx",
                                     "TEST_PASSWORD");


                Console.WriteLine("ExtractTables Sample");
                ExtractTables.Run(email, licenseKey, openPath,
                                  outputDir,
                                  configPath);

                Console.WriteLine("ExtractText Sample");
                ExtractText.Run(email, licenseKey, openPath,
                                outputDir + "ExtractText.txt",
                                configPath);

                Console.WriteLine("FlattenAnnots Sample");
                FlattenAnnots.Run(email, licenseKey, openPath,
                                  outputDir + "FlattenAnnots.pdf",
                                  new PdfFlattenAnnotsParams());

                Console.WriteLine("MakeAccessible Sample");
                MakeAccessible.Run(email, licenseKey, openPath,
                                   outputDir + "MakeAccessible.pdf",
                                   "en-us",
                                   "",
                                   configPath);

                Console.WriteLine("TagEditStructureTree Sample");
                TagEditStructureTree.Run(email, licenseKey, openPath,
                                         outputDir + "TagEditStructureTree.pdf");

                Console.WriteLine("TagsReadStructTree sample");
                TagsReadStructTree.Run(email, licenseKey, openPath, outputDir + "TagsReadStructTree.pdf");

                Console.WriteLine("TagsReadingOrder sample");
                TagsReadingOrder.Run(email, licenseKey, openPath, outputDir + "TagsReadingOrder.pdf");

                Console.WriteLine("TagTableAsFigure sample");
                TagTableAsFigure.Run(email, licenseKey, openPath, outputDir + "TagTableAsFigure.pdf");

                Console.WriteLine("TagHeadings Sample");
                TagHeadings.Run(email, licenseKey, openPath, outputDir + "TagHeadings.pdf");

                Console.WriteLine("TagAsArtifact Sample");
                TagAsArtifact.Run(email, licenseKey, openPath, outputDir + "TagAsArtifact.pdf");

                Console.WriteLine("OcrWithTesseract Sample");
                OcrWithTesseract.Run(email, licenseKey, openPath,
                                     outputDir + "OcrWithTesseract.pdf",
                                     resourcesDir + "tessdata\\",
                                     "eng");

                Console.WriteLine("ParsePdsObjects Sample");
                ParsePdsObjects.Run(email, licenseKey, openPath);

                Console.WriteLine("ThreadSafePdfix Sample");
                ThreadSafePdfix.Run(email, licenseKey, openPath);

                Console.WriteLine("SUCCESS");
            }
            catch (System.Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Пример #13
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="inputWidth"></param>
        /// <param name="inputHeight"></param>
        /// <param name="inputDepth"></param>
        /// <param name="batchSize"></param>
        /// <param name="initializtion">Initialization type for layers with weights</param>
        /// <param name="random"></param>
        public void Initialize(int inputWidth, int inputHeight, int inputDepth, int batchSize, Initialization initializtion, Random random)
        {
            m_random = new Random(random.Next());
            var fanIn = inputWidth * inputHeight * inputDepth;

            Width  = inputWidth;
            Height = inputHeight;
            Depth  = inputDepth;

            m_dropoutMask = Matrix <float> .Build.Dense(batchSize, fanIn);

            m_dropoutMask.Data().Map(() => DecideDropOut());

            m_activations = Matrix <float> .Build.Dense(batchSize, fanIn);

            m_delta = Matrix <float> .Build.Dense(batchSize, fanIn);
        }
Пример #14
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="initialization">Initialization type for the layers with weights (default is GlorotUniform)</param>
 public NeuralNet(Initialization initialization = Initialization.GlorotUniform)
 {
     m_initialization = initialization;
     Layers           = new List <ILayer>();
 }
Пример #15
0
 private static void Main()
 {
     ShadowFiend = new Initialization();
 }
Пример #16
0
        public void createDB()
        {
            try
            {
                // Name, Path and password

                string           cs         = string.Format("Version=3,uri=file:{0}", @Settings.sqlFile());
                SqliteConnection connection = new SqliteConnection(cs);
                connection.Open();
                System.Data.IDbCommand encryption = connection.CreateCommand();
                encryption.CommandText = "pragma hexkey='" + Initialization.parametersFromBinary("sqlitePassword") + "'";
                encryption.ExecuteNonQuery();

                // Database structure

                String[] sql_structure = { "create table config (parameter varchar(50), value varchar(100))" };

                foreach (string element in sql_structure)
                {
                    SqliteCommand command = new SqliteCommand(element, connection);
                    command.ExecuteNonQuery();
                }

                // Population of config table

                SqliteCommand insertSQL = new SqliteCommand("insert into config (parameter, value) VALUES ('" + Settings.TAFLAG + "', '" + Initialization.parametersFromBinary(Settings.TAFLAG) + "')", connection);
                insertSQL.ExecuteNonQuery();

                insertSQL = new SqliteCommand("insert into config (parameter, value) VALUES ('" + Settings.HEARTBEAT + "', '" + Initialization.parametersFromBinary(Settings.HEARTBEAT) + "')", connection);
                insertSQL.ExecuteNonQuery();

                insertSQL = new SqliteCommand("insert into config (parameter, value) VALUES ('" + Settings.UNIQUEGUID + "', '" + Settings.UNIQUEGUID_VALUE() + "')", connection);
                insertSQL.ExecuteNonQuery();

                insertSQL = new SqliteCommand("insert into config (parameter, value) VALUES ('" + Settings.SRFLAG + "', '" + Initialization.parametersFromBinary(Settings.SRFLAG) + "')", connection);
                insertSQL.ExecuteNonQuery();

                insertSQL = new SqliteCommand("insert into config (parameter, value) VALUES ('" + Settings.ANFLAG + "', '" + Initialization.parametersFromBinary(Settings.ANFLAG) + "')", connection);
                insertSQL.ExecuteNonQuery();

                insertSQL = new SqliteCommand("insert into config (parameter, value) VALUES ('" + Settings.AESKEYFLAG + "', '" + Initialization.parametersFromBinary(Settings.AESKEYFLAG) + "')", connection);
                insertSQL.ExecuteNonQuery();

                insertSQL = new SqliteCommand("insert into config (parameter, value) VALUES ('" + Settings.AESIVFLAG + "', '" + Initialization.parametersFromBinary(Settings.AESIVFLAG) + "')", connection);
                insertSQL.ExecuteNonQuery();

                insertSQL = new SqliteCommand("insert into config (parameter, value) VALUES ('" + Settings.EXEFLAG + "', '" + Initialization.parametersFromBinary(Settings.EXEFLAG) + "')", connection);
                insertSQL.ExecuteNonQuery();

                insertSQL = new SqliteCommand("insert into config (parameter, value) VALUES ('" + Settings.SRPWDFLAG + "', '" + Initialization.parametersFromBinary(Settings.SRPWDFLAG) + "')", connection);
                insertSQL.ExecuteNonQuery();

                insertSQL = new SqliteCommand("insert into config (parameter, value) VALUES ('" + Settings.HVERFLAG + "', '" + Initialization.parametersFromBinary(Settings.HVERFLAG) + "')", connection);
                insertSQL.ExecuteNonQuery();

                insertSQL = new SqliteCommand("insert into config (parameter, value) VALUES ('" + Settings.APOSTFIXFLAG + "', '" + Initialization.parametersFromBinary(Settings.APOSTFIXFLAG) + "')", connection);
                insertSQL.ExecuteNonQuery();

                insertSQL = new SqliteCommand("insert into config (parameter, value) VALUES ('" + Settings.REGFLAG + "', '" + Initialization.parametersFromBinary(Settings.REGFLAG) + "')", connection);
                insertSQL.ExecuteNonQuery();

                insertSQL = new SqliteCommand("insert into config (parameter, value) VALUES ('" + Settings.TPORTFLAG + "', '" + Initialization.parametersFromBinary(Settings.TPORTFLAG) + "')", connection);
                insertSQL.ExecuteNonQuery();

                connection.Close();
            }
            catch { }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="inputWidth"></param>
        /// <param name="inputHeight"></param>
        /// <param name="inputDepth"></param>
        /// <param name="batchSize"></param>
        /// <param name="initializtion"></param>
        /// <param name="random"></param>
        public void Initialize(int inputWidth, int inputHeight, int inputDepth, int batchSize, Initialization initializtion, Random random)
        {
            Width  = inputWidth;
            Height = inputHeight;
            Depth  = inputDepth;
            var fanOutAndIn = Width * Height * Depth;

            Scale = Matrix <float> .Build.Dense(1, fanOutAndIn, 1.0f); // scale is done pr. feature or pr. feature map.

            Bias = Vector <float> .Build.Dense(fanOutAndIn, 0.0f);

            BatchColumnMeans = new float[inputDepth];
            BatchcolumnVars  = new float[inputDepth];

            MovingAverageMeans    = new float[inputDepth];
            MovingAverageVariance = Enumerable.Range(0, inputDepth).Select(v => 1.0f).ToArray();

            ScaleGradients = Matrix <float> .Build.Dense(1, fanOutAndIn, 1);

            BiasGradients = Vector <float> .Build.Dense(fanOutAndIn);

            OutputActivations = Matrix <float> .Build.Dense(batchSize, fanOutAndIn);

            m_delta = Matrix <float> .Build.Dense(batchSize, fanOutAndIn);
        }
Пример #18
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="inputWidth"></param>
        /// <param name="inputHeight"></param>
        /// <param name="inputDepth"></param>
        /// <param name="batchSize"></param>
        /// <param name="initializtion"></param>
        /// <param name="random"></param>

        public void Initialize(int inputWidth, int inputHeight, int inputDepth, int batchSize, Initialization initializtion, Random random)
        {
            InputHeight = inputHeight;
            InputWidth  = inputWidth;
            InputDepth  = inputDepth;

            var filterGridWidth  = ConvUtils.GetFilterGridLength(InputWidth, FilterWidth, m_stride, m_padWidth, BorderMode);
            var filterGridHeight = ConvUtils.GetFilterGridLength(InputHeight, FilterHeight, m_stride, m_padHeight, BorderMode);

            // Calculations of dimensions based on:
            // Nvidia, cuDNN: Efficient Primitives for Deep Learning: https://arxiv.org/pdf/1410.0759.pdf
            var filterCubeSize = InputDepth * FilterWidth * FilterHeight;
            var filterGridSize = filterGridWidth * filterGridHeight;

            Height = filterGridHeight;
            Width  = filterGridWidth;
            Depth  = FilterCount;

            var fans         = WeightInitialization.GetFans(this, InputWidth, InputHeight, inputDepth);
            var distribution = WeightInitialization.GetWeightDistribution(initializtion, fans, random);

            Weights = Matrix <float> .Build.Random(FilterCount, filterCubeSize, distribution);

            WeightsGradients = Matrix <float> .Build.Dense(FilterCount, filterCubeSize);

            Bias = Vector <float> .Build.Dense(FilterCount, 0.0f);

            BiasGradients = Vector <float> .Build.Dense(FilterCount);

            Im2Cols = Matrix <float> .Build.Dense(filterCubeSize, filterGridSize *batchSize);

            Conv = Matrix <float> .Build.Dense(FilterCount, filterGridSize *batchSize);

            OutputActivations = Matrix <float> .Build.Dense(batchSize, FilterCount *filterGridSize);

            m_deltaInReshape = Matrix <float> .Build.Dense(FilterCount, filterGridSize *batchSize);

            var fanIn = inputWidth * inputHeight * inputDepth;

            m_delta = Matrix <float> .Build.Dense(batchSize, fanIn);
        }
Пример #19
0
        public void SetUp()
        {
            init = new Initialization();

            ml = init.CreateMl();

            user1 = new MailAddress("*****@*****.**");
            user2 = new MailAddress("*****@*****.**");
            //user3 = new MailAddress("*****@*****.**");
            user4 = new MailAddress("*****@*****.**");
            admin = new MailAddress("*****@*****.**");
            admin2 = new MailAddress("*****@*****.**");
            //mlCtrl = init.MlAddr.Ctrl;
            //mlPost = init.MlAddr.Post;
            mlAdmin = init.MlAddr.Admin;
            //mailDaemon = new MailAddress("*****@*****.**");
            user1Str = string.Format("\"USER1\" <{0}>", user1.ToString());
            //user2Str = string.Format("\"USER2\" <{0}>", user2.ToString());
            //user3Str = string.Format("\"USER3\" <{0}>", user3.ToString());
            user4Str = string.Format("\"USER4\" <{0}>", user4.ToString());
            //adminStr = string.Format("\"ADMIN\" <{0}>", admin.ToString());
            admin2Str = string.Format("\"ADMIN2\" <{0}>", admin2.ToString());
            mlCtrlStr = string.Format("\"1BAN(CTRL)\" <{0}>", init.MlAddr.Ctrl);
            mlPostStr = string.Format("\"1BAN\" <{0}>", init.MlAddr.Post);
            mlAdminStr = init.MlAddr.Admin.ToString();
            //mailDaemonStr = string.Format("\"Mail Delivery Subsystem\"<{0}>", mailDaemon.ToString());

            init.TestMailSave.Clear();//初期化
        }
Пример #20
0
        public void OnNavigation(ParametersOfForms param)
        {
            Initialization ini = new Initialization();
            ini.StartInitialization();

        }
Пример #21
0
 public static int Main(string[] args)
 {
     return(Initialization.BuildAndRun <Startup>("Catalog", args));
 }
Пример #22
0
 internal void CreateInstance()
 => Instance = Initialization == null?Activator.CreateInstance(ConcreteType) : Initialization.Invoke();
        /// <summary>
        ///
        /// </summary>
        /// <param name="inputWidth"></param>
        /// <param name="inputHeight"></param>
        /// <param name="inputDepth"></param>
        /// <param name="batchSize"></param>
        /// <param name="initializtion"></param>
        /// <param name="random"></param>

        public void Initialize(int inputWidth, int inputHeight, int inputDepth, int batchSize, Initialization initializtion, Random random)
        {
            OutputActivations = Matrix <float> .Build.Dense(batchSize, NumberOfClasses);

            m_delta = Matrix <float> .Build.Dense(batchSize, NumberOfClasses);
        }
Пример #24
0
 public void InitializeVariable()
 {
     this._Initialization = new Initialization();
     this._mlthandler     = MultiLanguageHandler.getInstance();
     this._Initialization.InitializePath();
 }
Пример #25
0
        static void Main(string[] args)
        {
            Log.EntryRecorded += (sender, e) => Console.WriteLine($"{sender} ({e.Severity}): {e.Message}");
            VerificationKeyProvider.Initialize("keyinfo.dat", "hello world");
            var vkp = new VerificationKeyProvider();

            Initialization.Run();
            SSMP ssmp = null;

            SSMP.InvitationReceived += (sender, e) =>
            {
                if (ssmp == null)
                {
                    ssmp = e.Accept();
                }
                ssmp.MessageReceived  += Ssmp_MessageReceived;
                ssmp.ConnectionClosed += (_sender, _e) => ssmp = null;
            };
            var ei = new ErebusInstance(new ErebusAddress(Console.ReadLine()));

            ei.Services = new[] { HDPService.SSMP };
            var l = new TCPIPConnectionListener(int.Parse(Console.ReadLine()), ei);

            while (true)
            {
                try
                {
                    var cmd = Console.ReadLine().Split(' ');
                    switch (cmd[0])
                    {
                    case "addlink":
                        new ErebusLink(TCPIPConnectionUtils.Connect(cmd[1], int.Parse(cmd[2])), ei, false);
                        break;

                    case "listlink":
                        foreach (var link in ei.Links)
                        {
                            Console.WriteLine(link.RemoteAddress);
                        }
                        break;

                    case "hdp":
                        var hdp = new HDP(ei, HDPService.SSMP);
                        hdp.SendRequest(ErebusAddress.Broadcast);
                        hdp.InitClose();
                        break;

                    case "ssmp":
                        ssmp = new SSMP(ei, new ErebusAddress(cmd[1]));
                        ssmp.MessageReceived += Ssmp_MessageReceived;
                        break;

                    case "msg":
                        ssmp?.SendMessage(cmd.Skip(1).Aggregate((x, y) => x + " " + y));
                        break;

                    case "addkey":
                        var addr = new ErebusAddress(cmd[1]);
                        vkp.RemoveKeyPair(addr);
                        var key = vkp.CreatePrivateKey();
                        Console.WriteLine("Key: " + key.Item2.Select(x => x.ToString()).Aggregate((x, y) => x + "," + y));
                        Console.Write("Please copy other key to clipboard, then press <enter> . . .");
                        Console.ReadLine();
                        vkp.AddKeyPair(addr, key.Item1, Clipboard.GetText().Split(',').Select(x => byte.Parse(x)).ToArray());
                        break;

                    case "removekey":
                        vkp.RemoveKeyPair(new ErebusAddress(cmd[1]));
                        break;

                    case "close":
                        ssmp?.Dispose();
                        ssmp = null;
                        break;

                    case "exit":
                        return;
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
            }
        }
Пример #26
0
 public void LoadListBooking()
 {
     list_booking = Initialization.LoadBookingList("john", "tyler", Convert.ToDateTime("02/01/1988"), "123", "Toyota", Convert.ToDateTime("02/09/2019"), Convert.ToDateTime("02/09/2019"), 0, Convert.ToDateTime("10:00"), Convert.ToDateTime("11:00"), Convert.ToDateTime("02/09/2019"), 1, "Airport", "Midtown");
     list_booking = Initialization.LoadBookingList("Raj", "Khan", Convert.ToDateTime("02/01/1989"), "345", "Toyota SUV", Convert.ToDateTime("02/09/2019"), Convert.ToDateTime("02/09/2019"), 0, Convert.ToDateTime("10:00"), Convert.ToDateTime("11:00"), Convert.ToDateTime("02/09/2019"), 2, "Airport", "Midtown");
     list_booking = Initialization.LoadBookingList("Kevin", "tse", Convert.ToDateTime("02/01/1991"), "786", "Mid Size SUV", Convert.ToDateTime("02/09/2019"), Convert.ToDateTime("02/10/2019"), 0, Convert.ToDateTime("10:00"), Convert.ToDateTime("11:00"), Convert.ToDateTime("02/09/2019"), 3, "Airport", "Midtown");
 }
Пример #27
0
        public bool SetParameters(string fileName)
        {
            ParameterFiles parameterFiles = ParameterFiles.LoadFromXml(fileName);

            if (parameterFiles == null)
            {
                return(false);
            }
            object obj1 = (object)null;
            object obj2 = (object)Initialization.LoadFromXml(parameterFiles.Initialization);

            if (obj2 == null)
            {
                return(false);
            }
            this.Init = (Initialization)obj2;
            obj1      = (object)null;
            object obj3 = (object)Mutation.LoadFromXml(parameterFiles.Mutation);

            if (obj3 == null)
            {
                return(false);
            }
            this.Mutate = (Mutation)obj3;
            obj1        = (object)null;
            object obj4 = (object)Reproduction.LoadFromXml(parameterFiles.Reproduction);

            if (obj4 == null)
            {
                return(false);
            }
            this.Reprod = (Reproduction)obj4;
            obj1        = (object)null;
            object obj5 = (object)Saving.LoadFromXml(parameterFiles.Saving);

            if (obj5 == null)
            {
                return(false);
            }
            this.Saves = (Saving)obj5;
            obj1       = (object)null;
            object obj6 = (object)Speciation.LoadFromXml(parameterFiles.Speciation);

            if (obj6 == null)
            {
                return(false);
            }
            this.Speciate      = (Speciation)obj6;
            Species.Compatible = this.Speciate;
            obj1 = (object)null;
            object obj7 = (object)Testing.LoadFromXml(parameterFiles.Testing);

            if (obj7 == null)
            {
                return(false);
            }
            this.Tests = (Testing)obj7;
            obj1       = (object)null;
            object obj8 = (object)HyperNEAT.LoadFromXml(parameterFiles.HyperNEAT);

            if (obj8 == null)
            {
                return(false);
            }
            Substrates.param = (HyperNEAT)obj8;
            return(true);
        }
Пример #28
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="inputWidth"></param>
        /// <param name="inputHeight"></param>
        /// <param name="inputDepth"></param>
        /// <param name="batchSize"></param>
        /// <param name="initializtion"></param>
        /// <param name="random"></param>

        public void Initialize(int inputWidth, int inputHeight, int inputDepth, int batchSize, Initialization initializtion, Random random)
        {
            InputWidth  = inputWidth;
            InputHeight = inputHeight;
            InputDepth  = inputDepth;

            // computed
            this.Depth  = this.InputDepth;
            this.Width  = ConvUtils.GetFilterGridLength(InputWidth, m_poolWidth, m_stride, m_padWidth, BorderMode);
            this.Height = ConvUtils.GetFilterGridLength(InputHeight, m_poolHeight, m_stride, m_padHeight, BorderMode);

            // store switches for x,y coordinates for where the max comes from, for each output neuron
            this.Switchx = Enumerable.Range(0, batchSize).Select(v => new int[this.Width * this.Height * this.Depth]).ToArray();
            this.Switchy = Enumerable.Range(0, batchSize).Select(v => new int[this.Width * this.Height * this.Depth]).ToArray();

            var fanIn  = InputWidth * InputDepth * InputHeight;
            var fanOut = Depth * Width * Height;

            OutputActivations = Matrix <float> .Build.Dense(batchSize, fanOut);

            m_delta = Matrix <float> .Build.Dense(batchSize, fanIn);
        }
Пример #29
0
 public static void run()
 {
     Initialization.JsonImportInitialization();
     Initialization.CemInitialization();
 }
Пример #30
0
        /// <summary>
        /// Loads the directories json files from configuration.
        /// </summary>
        /// <param name="configurationBuilder">The configuration builder.</param>
        /// <param name="self">The self.</param>
        /// <returns></returns>
        public static IConfigurationBuilder LoadDirectoriesJsonFiles(this IConfigurationBuilder configurationBuilder, Initialization self)
        {
            if (self.ConfigurationPaths != null)
            {
                bool configLoaded = false;

                foreach (var configuration in self.ConfigurationPaths)
                {
                    var dir = new DirectoryInfo(Path.Combine(Environment.CurrentDirectory, configuration));
                    if (dir.Exists)
                    {
                        foreach (var file in dir.GetFiles("*.json"))
                        {
                            if (EvaluateJson(file))
                            {
                                configLoaded = true;
                                Trace.WriteLine($"add configuration file '{file.FullName}'", TraceLevel.Info.ToString());
                                configurationBuilder.AddJsonFile(file.FullName, optional: false, reloadOnChange: false);
                            }
                        }
                    }
                }

                if (!configLoaded)
                {
                    Trace.WriteLine("no configuration file loaded", TraceLevel.Info.ToString());
                }
            }
            else
            {
                Trace.WriteLine("no configuration folder specified", TraceLevel.Info.ToString());
            }

            return(configurationBuilder);
        }
Пример #31
0
 /// <summary>
 /// https://github.com/louthy/language-ext/issues/207
 /// </summary>
 public Task <Either <Exception, int> > Issue207() =>
 Initialization
 .BindT(createUserMapping)
 .BindT(addUser);
Пример #32
0
 protected void Application_Start(object sender, EventArgs e)
 {
     Initialization.SetServices();
     InitMonitoring();
 }
Пример #33
0
 private void btn_start_Click(object sender, RoutedEventArgs e)
 {
     #region Confirm the format
     if (tb_inputFilePath.Text == String.Empty ||
         tb_outputPath.Text == String.Empty ||
         tb_lbound.Text == String.Empty ||
         tb_ubound.Text == String.Empty ||
         tb_a1.Text == String.Empty ||
         tb_a2.Text == String.Empty ||
         tb_a3.Text == String.Empty)
     {
         System.Windows.MessageBox.Show("Please complete input!");
         return;
     }
     try
     {
         Globals.LBound = Convert.ToInt32(tb_lbound.Text);
         Globals.UBound = Convert.ToInt32(tb_ubound.Text);
         Globals.A1     = Convert.ToDouble(tb_a1.Text);
         Globals.A2     = Convert.ToDouble(tb_a2.Text);
     }
     catch (Exception)
     {
         System.Windows.MessageBox.Show("Input string was not in a correct format.");
         return;
     }
     if (Globals.LBound >= Globals.UBound)
     {
         System.Windows.MessageBox.Show("UBound is smaller than LBound!");
         return;
     }
     if ((Globals.A1 > 1 || Globals.A1 < 0) ||
         (Globals.A2 > 1 || Globals.A2 < 0))
     {
         System.Windows.MessageBox.Show("The weight a1,a2,a3 ∈ (0,1]");
         return;
     }
     #endregion
     if (rb_hierarchical.IsChecked.Value)
     {
         initMethod = Initialization.HIERARCHICHAL;
     }
     else if (rb_RHier.IsChecked.Value)
     {
         initMethod = Initialization.RHIE;
     }
     else
     {
         initMethod = Initialization.NORMAL;
     }
     if (rb_minMax.IsChecked.Value)
     {
         normMethod = Normalization.MIN_MAX;
     }
     else
     {
         normMethod = Normalization.NONE;
     }
     if (rb_balance.IsChecked.Value)
     {
         diverMethod = Diversification.BALANCE;
     }
     else
     {
         diverMethod = Diversification.RERHIE;
     }
     fileL   = new FileStream(outputPath + "\\log_" + Globals.FileName + "_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".txt", FileMode.OpenOrCreate, FileAccess.Write, FileShare.None, 4096, true);
     Util.sw = new StreamWriter(fileL);
     m_LB    = tb_lbound.Text;
     m_UB    = tb_ubound.Text;
     //将聚类任务交给bgw,锁定开始按钮
     //assign the task to bgw, disable the start button
     bgw.RunWorkerAsync();
     btn_start.IsEnabled = false;
 }
Пример #34
0
        /// <summary>
        /// Initializes the Main CommServer Component using specified configuration file name.
        /// </summary>
        /// <param name="configurationFileName">The configuration file name.</param>
        public void Initialize(string configurationFileName, ISettingsBase settings)
        {
            if (m_isInitialized)
            {
                throw new ApplicationException("Only one initialization of CommServerComponent is allowed.");
            }
            m_isInitialized = true;
            int  cEventID     = (int)Error.CommServer_CommServerComponent;
            bool m_DemoVer    = true;
            int  cRTConstrain = 2;
            int  cVConstrain  = 15;

            LicenseManager.IsValid(this.GetType(), this, out License lic);
            LicenseFile m_license = lic as LicenseFile;

            if (m_license == null)
            {
                EventLogMonitor.WriteToEventLog(Resources.Tx_LicNoFileErr, EventLogEntryType.Error, cEventID, 93);
            }
            else
            {
                using (lic)
                {
                    MaintenanceControlComponent mcc = new MaintenanceControlComponent();
                    if (mcc.Warning != null)
                    {
                        Tracer.TraceWarning(143, this.GetType().Name, "The following warning(s) appeared during loading the license: " + mcc.Warning);
                    }
                    if (m_license.FailureReason != string.Empty)
                    {
                        EventLogMonitor.WriteToEventLog(m_license.FailureReason, EventLogEntryType.Error, cEventID, 95);
                    }
                    else
                    {
                        m_DemoVer = false;
                        EventLogMonitor.WriteToEventLog("Opened the license: " + m_license.ToString(), EventLogEntryType.Information, cEventID, 98);
                        cRTConstrain = m_license.RunTimeConstrain;
                        if (m_license.VolumeConstrain < 0)
                        {
                            cVConstrain = int.MaxValue;
                        }
                        else
                        {
                            cVConstrain = m_license.VolumeConstrain;
                        }
                    }
                }
            }
            if (m_DemoVer)
            {
                EventLogMonitor.WriteToEventLog(Resources.Tx_LicDemoModeInfo, EventLogEntryType.Information, cEventID, 98);
            }
            string cProductName;
            string cProductVersion;
            string cFullName;

            cProductName    = Assembly.GetExecutingAssembly().GetName().Name;
            cProductVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
            cFullName       = Assembly.GetExecutingAssembly().GetName().FullName;
            ulong vd        = m_RuntimeStopWatch.Start;
            int   cVcounter = cVConstrain;

            EventLogMonitor.WriteToEventLog("Communication server started - product name:" + cFullName, EventLogEntryType.Information, (int)Error.CommServer_CommServerComponent, 130);
            Initialization.InitializeServer(this, m_DemoVer, ref cVcounter, configurationFileName, settings);
            ConsoleIterface.Start(cProductName, cProductVersion);
            if (cVcounter <= 0)
            {
                EventLogMonitor.WriteToEventLog("Some tags have not been added due to license limitation – the volume constrain have been reached", EventLogEntryType.Warning, (int)Error.CommServer_CommServerComponent, 134);
            }
            else
            {
                string msg = string.Format("Initiated {0} tags, The license allows you to add {1} more tags. ", cVConstrain - cVcounter, cVcounter);
                EventLogMonitor.WriteToEventLog(msg, EventLogEntryType.Information, (int)Error.CommServer_CommServerComponent, 139);
            }
            if (cRTConstrain > 0)
            {
                string msg = string.Format("Runtime of the product is constrained up to {0} hours.", cRTConstrain);
                EventLogMonitor.WriteToEventLog(msg, EventLogEntryType.Warning, (int)Error.CommServer_CommServerComponent, 145);
                m_RunTimeout = new System.Timers.Timer(cRTConstrain * 60 * 60 * 1000);
                m_RunTimeout.Start();
                m_RunTimeout.Elapsed += new System.Timers.ElapsedEventHandler(m_RunTimeout_Elapsed);
            }
        }
Пример #35
0
        /// <summary>
        /// LUA结构支持
        /// </summary>
        /// <returns></returns>
        public override void GetLuaStruct(StringBuilder code)
        {
            base.GetLuaStruct(code);
            int idx;

            if (!string.IsNullOrWhiteSpace(PropertyName))
            {
                code.AppendLine($@"['PropertyName'] = '{PropertyName.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['PropertyName'] = nil,");
            }

            code.AppendLine($@"['IsCaption'] ={(IsCaption.ToString().ToLower())},");

            if (!string.IsNullOrWhiteSpace(Alias))
            {
                code.AppendLine($@"['Alias'] = '{Alias.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['Alias'] = nil,");
            }

            if (!string.IsNullOrWhiteSpace(Group))
            {
                code.AppendLine($@"['Group'] = '{Group.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['Group'] = nil,");
            }

            code.AppendLine($@"['CreateIndex'] ={(CreateIndex.ToString().ToLower())},");

            code.AppendLine($@"['IsPrimaryKey'] ={(IsPrimaryKey.ToString().ToLower())},");

            code.AppendLine($@"['IsExtendKey'] ={(IsExtendKey.ToString().ToLower())},");

            code.AppendLine($@"['IsIdentity'] ={(IsIdentity.ToString().ToLower())},");

            code.AppendLine($@"['IsGlobalKey'] ={(IsGlobalKey.ToString().ToLower())},");

            code.AppendLine($@"['UniqueIndex'] ={UniqueIndex},");

            code.AppendLine($@"['IsRequired'] ={(IsRequired.ToString().ToLower())},");

            code.AppendLine($@"['IsUserReadOnly'] ={(IsUserReadOnly.ToString().ToLower())},");

            code.AppendLine($@"['IsMemo'] ={(IsMemo.ToString().ToLower())},");


            code.AppendLine($@"['DenyClient'] ={(DenyClient.ToString().ToLower())},");

            if (!string.IsNullOrWhiteSpace(Prefix))
            {
                code.AppendLine($@"['Prefix'] = '{Prefix.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['Prefix'] = nil,");
            }

            if (!string.IsNullOrWhiteSpace(Suffix))
            {
                code.AppendLine($@"['Suffix'] = '{Suffix.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['Suffix'] = nil,");
            }

            if (!string.IsNullOrWhiteSpace(InputType))
            {
                code.AppendLine($@"['InputType'] = '{InputType.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['InputType'] = nil,");
            }

            if (!string.IsNullOrWhiteSpace(ComboBoxUrl))
            {
                code.AppendLine($@"['ComboBoxUrl'] = '{ComboBoxUrl.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['ComboBoxUrl'] = nil,");
            }

            code.AppendLine($@"['IsMoney'] ={(IsMoney.ToString().ToLower())},");

            if (!string.IsNullOrWhiteSpace(GridAlign))
            {
                code.AppendLine($@"['GridAlign'] = '{GridAlign.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['GridAlign'] = nil,");
            }

            if (!string.IsNullOrWhiteSpace(DataFormater))
            {
                code.AppendLine($@"['DataFormater'] = '{DataFormater.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['DataFormater'] = nil,");
            }

            code.AppendLine($@"['DenyClient'] ={(DenyClient.ToString().ToLower())},");

            code.AppendLine($@"['GridDetails'] ={(GridDetails.ToString().ToLower())},");

            code.AppendLine($@"['NoneGrid'] ={(NoneGrid.ToString().ToLower())},");

            code.AppendLine($@"['NoneDetails'] ={(NoneDetails.ToString().ToLower())},");

            if (!string.IsNullOrWhiteSpace(GridDetailsCode))
            {
                code.AppendLine($@"['GridDetailsCode'] = '{GridDetailsCode.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['GridDetailsCode'] = nil,");
            }

            if (!string.IsNullOrWhiteSpace(CppType))
            {
                code.AppendLine($@"['CppType'] = '{CppType.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['CppType'] = nil,");
            }

            if (CppTypeObject != null)
            {
                code.AppendLine($@"['CppTypeObject'] ='{CppTypeObject}',");
            }

            if (!string.IsNullOrWhiteSpace(CppName))
            {
                code.AppendLine($@"['CppName'] = '{CppName.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['CppName'] = nil,");
            }

            if (!string.IsNullOrWhiteSpace(CppLastType))
            {
                code.AppendLine($@"['CppLastType'] = '{CppLastType.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['CppLastType'] = nil,");
            }

            code.AppendLine($@"['IsIntDecimal'] ={(IsIntDecimal.ToString().ToLower())},");

            if (!string.IsNullOrWhiteSpace(CsType))
            {
                code.AppendLine($@"['CsType'] = '{CsType.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['CsType'] = nil,");
            }

            if (!string.IsNullOrWhiteSpace(CustomType))
            {
                code.AppendLine($@"['CustomType'] = '{CustomType.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['CustomType'] = nil,");
            }

            if (!string.IsNullOrWhiteSpace(LastCsType))
            {
                code.AppendLine($@"['LastCsType'] = '{LastCsType.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['LastCsType'] = nil,");
            }

            if (EnumConfig != null)
            {
                code.AppendLine($@"['EnumConfig'] = {EnumConfig.GetLuaStruct()},");
            }

            code.AppendLine($@"['IsCompute'] ={(IsCompute.ToString().ToLower())},");

            if (!string.IsNullOrWhiteSpace(ComputeGetCode))
            {
                code.AppendLine($@"['ComputeGetCode'] = '{ComputeGetCode.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['ComputeGetCode'] = nil,");
            }

            if (!string.IsNullOrWhiteSpace(ComputeSetCode))
            {
                code.AppendLine($@"['ComputeSetCode'] = '{ComputeSetCode.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['ComputeSetCode'] = nil,");
            }

            code.AppendLine($@"['IsMiddleField'] ={(IsMiddleField.ToString().ToLower())},");

            code.AppendLine($@"['InnerField'] ={(InnerField.ToString().ToLower())},");

            code.AppendLine($@"['IsSystemField'] ={(IsSystemField.ToString().ToLower())},");

            code.AppendLine($@"['IsInterfaceField'] ={(IsInterfaceField.ToString().ToLower())},");

            if (!string.IsNullOrWhiteSpace(Initialization))
            {
                code.AppendLine($@"['Initialization'] = '{Initialization.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['Initialization'] = nil,");
            }

            if (!string.IsNullOrWhiteSpace(EmptyValue))
            {
                code.AppendLine($@"['EmptyValue'] = '{EmptyValue.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['EmptyValue'] = nil,");
            }

            code.AppendLine($@"['DenyScope'] ='{DenyScope}',");

            code.AppendLine($@"['Nullable'] ={(Nullable.ToString().ToLower())},");

            if (!string.IsNullOrWhiteSpace(Max))
            {
                code.AppendLine($@"['Max'] = '{Max.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['Max'] = nil,");
            }

            if (!string.IsNullOrWhiteSpace(Min))
            {
                code.AppendLine($@"['Min'] = '{Min.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['Min'] = nil,");
            }

            code.AppendLine($@"['UniqueString'] ={(UniqueString.ToString().ToLower())},");

            if (!string.IsNullOrWhiteSpace(ColumnName))
            {
                code.AppendLine($@"['ColumnName'] = '{ColumnName.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['ColumnName'] = nil,");
            }

            code.AppendLine($@"['DbNullable'] ={(DbNullable.ToString().ToLower())},");

            if (!string.IsNullOrWhiteSpace(DbType))
            {
                code.AppendLine($@"['DbType'] = '{DbType.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['DbType'] = nil,");
            }

            code.AppendLine($@"['Precision'] ={Datalen},");

            if (!string.IsNullOrWhiteSpace(ArrayLen))
            {
                code.AppendLine($@"['ArrayLen'] = '{ArrayLen.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['ArrayLen'] = nil,");
            }

            code.AppendLine($@"['Scale'] ={Scale},");

            code.AppendLine($@"['DbIndex'] ={DbIndex},");

            code.AppendLine($@"['Unicode'] ={(Unicode.ToString().ToLower())},");

            code.AppendLine($@"['FixedLength'] ={(FixedLength.ToString().ToLower())},");

            code.AppendLine($@"['IsBlob'] ={(IsBlob.ToString().ToLower())},");

            if (!string.IsNullOrWhiteSpace(StorageProperty))
            {
                code.AppendLine($@"['StorageProperty'] = '{StorageProperty.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['StorageProperty'] = nil,");
            }

            code.AppendLine($@"['DbInnerField'] ={(DbInnerField.ToString().ToLower())},");

            code.AppendLine($@"['NoStorage'] ={(NoStorage.ToString().ToLower())},");

            code.AppendLine($@"['KeepStorageScreen'] ='{KeepStorageScreen}',");

            code.AppendLine($@"['CustomWrite'] ={(CustomWrite.ToString().ToLower())},");

            code.AppendLine($@"['IsLinkField'] ={(IsLinkField.ToString().ToLower())},");

            if (!string.IsNullOrWhiteSpace(LinkTable))
            {
                code.AppendLine($@"['LinkTable'] = '{LinkTable.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['LinkTable'] = nil,");
            }

            code.AppendLine($@"['IsLinkKey'] ={(IsLinkKey.ToString().ToLower())},");

            code.AppendLine($@"['IsLinkCaption'] ={(IsLinkCaption.ToString().ToLower())},");

            code.AppendLine($@"['IsUserId'] ={(IsUserId.ToString().ToLower())},");

            if (!string.IsNullOrWhiteSpace(LinkField))
            {
                code.AppendLine($@"['LinkField'] = '{LinkField.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['LinkField'] = nil,");
            }

            code.AppendLine($@"['IsCustomCompute'] ={(IsCustomCompute.ToString().ToLower())},");

            code.AppendLine($@"['CanGet'] ={(CanGet.ToString().ToLower())},");

            code.AppendLine($@"['CanSet'] ={(CanSet.ToString().ToLower())},");

            if (!string.IsNullOrWhiteSpace(AccessType))
            {
                code.AppendLine($@"['AccessType'] = '{AccessType.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['AccessType'] = nil,");
            }

            code.AppendLine($@"['ReadOnly'] ={(ReadOnly.ToString().ToLower())},");

            code.AppendLine($@"['CanInput'] ={(CanUserInput.ToString().ToLower())},");

            if (!string.IsNullOrWhiteSpace(ExtendRole))
            {
                code.AppendLine($@"['ExtendRole'] = '{ExtendRole.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['ExtendRole'] = nil,");
            }

            if (!string.IsNullOrWhiteSpace(ValueSeparate))
            {
                code.AppendLine($@"['ValueSeparate'] = '{ValueSeparate.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['ValueSeparate'] = nil,");
            }

            if (!string.IsNullOrWhiteSpace(ArraySeparate))
            {
                code.AppendLine($@"['ArraySeparate'] = '{ArraySeparate.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['ArraySeparate'] = nil,");
            }

            code.AppendLine($@"['ExtendArray'] ={(ExtendArray.ToString().ToLower())},");

            code.AppendLine($@"['IsKeyValueArray'] ={(IsKeyValueArray.ToString().ToLower())},");

            code.AppendLine($@"['IsRelation'] ={(IsRelation.ToString().ToLower())},");

            if (!string.IsNullOrWhiteSpace(ExtendPropertyName))
            {
                code.AppendLine($@"['ExtendPropertyName'] = '{ExtendPropertyName.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['ExtendPropertyName'] = nil,");
            }

            if (!string.IsNullOrWhiteSpace(ExtendClassName))
            {
                code.AppendLine($@"['ExtendClassName'] = '{ExtendClassName.ToLuaString()}',");
            }
            else
            {
                code.AppendLine($@"['ExtendClassName'] = nil,");
            }

            code.AppendLine($@"['ExtendClassIsPredestinate'] ={(ExtendClassIsPredestinate.ToString().ToLower())},");

            code.AppendLine($@"['IsRelationField'] ={(IsRelationField.ToString().ToLower())},");

            code.AppendLine($@"['IsRelationValue'] ={(IsRelationValue.ToString().ToLower())},");

            code.AppendLine($@"['IsRelationArray'] ={(IsRelationArray.ToString().ToLower())},");

            code.AppendLine($@"['IsExtendArray'] ={(IsExtendArray.ToString().ToLower())},");

            code.AppendLine($@"['IsExtendValue'] ={(IsExtendValue.ToString().ToLower())},");
        }
Пример #36
0
        //[Test]
        public void AddProtoRun()
        {
            var db = Database.GetProductionDatabase(new MongoHostInfo("beast", "guest", "guest", "versace"));

            new ProtoRun(db, "Paper", 100, Initialization.MakeProtoChromosome(), 10, 6, 4, 4, 0.05);
        }
Пример #37
0
 private static void Main()
 {
     ModifierMasterInitialization = new Initialization();
 }
Пример #38
0
 // Use this for initialization
 void Start()
 {
     init = GameObject.Find ("StartPlatform").GetComponent<Initialization> ();
     connectionID = 0;
 }