Categories
Ask Mathematics

Markov models and calculating the period of each state

I am currently studying Markov models from the textbook Introduction to Modeling and Analysis of Stochastic Systems, second edition, by Kulkarni. I have just encountered the concept of periodicity in chapter 2: Definition 2.4. (Periodicity). Let $\{ X_n, n \ge 0 \}$ be an irreducible DTMC on state space $S = \{1, 2, \dots, N […]

Categories
Development

Using regular expressions to multiply and sum numeric string characters contained in a hash of mixed numeric strings

Without getting too much into biology, Proteins are made of Amino Acids. Each of the 20 Amino Acids that make up Proteins are represented by characters in a sequence. Each Amino Acid char has a different chemical formula, which I represent as strings. For example, “M” has a formula of “C5H11NO2S” Given the 20 different […]

Categories
Development

Time difference in execution of MySQL joins

I had a queries in which there was left joins were used and it was taking 30 seconds to complete the execution and return the dataset on mysql terminal. But when I have changed it to join its execution time has been reduced significantly from 30 to 12 seconds. I know this is too much […]

Categories
Development

Why is Entity Framework Core attempting to insert records into one of the tables from many to many relationships and NOT the join table?

Given the following set up where there are many Teams and there are many LeagueSessions. Each Team belongs to zero or more LeagueSessions but only ever one LeagueSession is active. LeagueSessions have many teams, and the teams will be repeated. Many-to-many relationship is established between Teams and LeagueSessions with a join table called TeamsSessions. Team […]

Categories
Development

pyarrow parquet – encoding array into list of records

I am creating parquet files using Pandas and pyarrow and then reading schema of those files using Java (org.apache.parquet.avro.AvroParquetReader). I found out that parquet files created using pandas + pyarrow always encode arrays of primitive types using an array of records with single field. I could not find anyone else having this issue – so […]

Categories
Development

doesn’t compile code with Include AzureIoThub.h on esp8266 device

I’m trying to connect my esp8266 device to azure IOT hub, and from my understanding the way to go is to use the official AzureIoThub library (as distributed on library manager) but somewhy any code with this included library doesn’t compile. I get the following errors upon including the library. Arduino: 1.8.9 (Windows Store 1.8.21.0) […]

Categories
Android Database Development Firebase

How to count the number of periods a student presents on a given days in Firebase real time database on Android?

here is a result of the code for com(R)020-09 I am trying to develop an android application for student attendance taker and I want to count the number of periods a student exists to calculate the percentage of his or her presence. but it doesn’t return the correct values. Please help me I am a […]

Categories
Development

alternate way to execute stored proc using simplejdbccall

Unable to execute a stored procedure by using named parameters. The SQL Server profiler for my execution showed a lengthy SQL including the null values. Is there any other way I can execute the stored procedure preferably using spring-jdbc which creates readable sql something similar to shown below under Expected? I tried to build SimpleJdbcCall […]

Categories
Development

How to subset a dataframe with multiple conditions involving days and values for two factor variables in R?

I have a dataset with the structure shown below. dat <- data.frame(     event = c(“A”, “A”, “A”, “B”, “B”, “B”, “B”, “C”, “C”, “C”),     place =c(“p1”, “p1”, “p2”, “p3”, “p3”, “p3”, “p4″,”p4″,”p4”, “p5”),     day = c(“May 1″,”May 2″,”May 3”, “May 4”, “May 5”, “May 6”, “May 7”, “May 8”, […]

Categories
Development

Why does nested array crach excel when it reaches upper limit?

I have the following code which crashes excel when run: Option Explicit Private Type Calculations x As Double x2 As Double x3 As Double x4 As Double x5 As Double h1 As Double v1 As Double a1 As Double p1 As Double h2 As Double v2 As Double a2 As Double p2 As Double h3 […]