Wednesday, December 25, 2019

Windows Information Provider (VB6 open source project)

Windows Information Provider Version 1.2.2 is an advanced app made by A_X_O (unfortunately I did not find his real name). It is a software that can teach you about everything inside the Windows 10 OS. This project is open source and can be modified, you can take parts of it as you need and you can ask A_X_O a little bit more about it (if he has the time to do so). You may wish to search for A_X_O on PSC/Internet, as he has published many advanced software as open source, made in the great VB6 programming language!

Download VB6 source code from PSC

Download VB6 from MediaFire

Download from ME

Final update: September 05th 2019
Now In Complete Applications Section

Drives: Drive, Label, File System, Serial...
Object Search: Object Name, DOS Path, Extension...
System: Description, Bootup State, Manufacturer...
Services: Service Name, ProcessID, State...
Accounts: Domain, Account, Password Required...
Software: Program Groups, Reliability Records, Installed Software...
Registry Search: Search Keys, Value, Data
Processes: Command Line, Handle, Parent Process ID, ProcessID...
TCP/UDP Tables: TCP/IP V4 & V6 Raw Data, UDP/IP V4 & V6 Raw Data
Peripherals: Keyboard, Pointing Device, Sound Card...
Recycle Bin Info: Item Count, Size
Processor: Current Clock Speed, Manufacturer...
Memory Info: BankLabel, Capacity, Manufacturer...
Security Settings: Anti-Malware, Anti-Spyware, Anti-Virus...
WMI Folder Listings: Details of Directories from WMI
WMI File Listings: Details of Files from WMI
View Hidden Object Status: View and Set Hidden Object Status
Common Folders: Quick Access to Common Directories
Google Chrome Extensions:Profile, Extension ID, Name, Version, Permissions, Installed, Key

Windows Information Provider Version 1.2.2













Sunday, December 8, 2019

Experimenting with Markov Chains: Prediction and Simulation

For those interested in experimenting with Markov Chains, we found a new type of app implemented in four or five different programming languages, including VB6. The applications below represent a prediction and a simulator for different experiments related to Markov Chains, both developed by Dr. Paul A. Gagniuc for a math book (Gagniuc, Paul A. (2017). Markov Chains: From Theory to Implementation and Experimentation. USA, NJ: John Wiley & Sons. pp. 1–235. ISBN 978-1-119-38755-8.). These apps are available as binary files and source code.


The prediction app:


Markov Chains - Prediction Framework

The simulation app:

Markov Chains - Simulation Framework

A weather prediction application with animation:


Download from me
Download from Wiley

Markov Chains - The Weather


Sources:

1. https://www.wiley.com/en-gb/Markov+Chains%3A+From+Theory+to+Implementation+and+Experimentation-p-9781119387558

2. https://transition-matrix.blogspot.com/




Discrete Probability Detector algorithm

'###################################################################################################
'# John Wiley & Sons, Inc.                                                                         #
'#                                                                                                 #
'# Book:   Markov Chains: From Theory To Implementation And Experimentation                        #
'# Author: Dr. Paul Gagniuc                                                                        #
'# Data:   01/05/2017                                                                              #
'#                                                                                                 #
'# Title:                                                                                          #
'# Discrete Probability Detector                                                                   #
'#                                                                                                 #
'# Short Description:                                                                              #
'# The purpose of this algorithm is to convert any string into a probability matrix.               #
'#_______________________                                                                          #
'# Detailed description: \                                                                         #
'# This algorithm is an advanced variation of the "ExtractProb" function from the book. The        #
'# main difference between "ExtractProb" function and the DPD algorithm is the automatic           #
'# identification of states.                                                                       #
'#_________________________________________________________________________________________________#
'# Initially, the states are identified in the first phase. Each new letter found in "S" is        #
'# appended to the string forming in variable "a". Thus, variable "a" gradually increases until    #
'# all types of letters from "S" are identified.                                                   #
'#_________________________________________________________________________________________________#
'# In the second phase the elements of matrix "m" are filled with zero values for later            #
'# purposes. Also, in the second phase the first column of matrix "e" is filled with letters       #
'# found in variable "a", and the second column of matrix "e" is filled with zero values for       #
'# later use.                                                                                      #
'#_________________________________________________________________________________________________#
'# In the third phase, the transitions between letters of "S" are counted and stored in            #
'# matrix "m".                                                                                     #
'# The strategy in this particular case is to fill matrix "m" with transition counts before the    #
'# last letter in "S" is reached. In this case, the first column of matrix "e" already contains    #
'# the letters from variable "a". The two components of vector "l" contain the "i" and "i+1"       #
'# letters from "S". The count of individual transitions between letters is made by a comparison   #
'# between vector "l" and the elements from the first column of matrix "e". The number of rows     #
'# in matrix "m" and matrix "e" is the same, namely "d". Therefore, an extra loop can be avoided   #
'# by mapping matrix "m" through a coordinate system. For instance, if the letter from position    #
'# "i" in "S" stored in "l(0)" and the letter from "j" row in matrix "e" (e(j,0)) are the same     #
'# then variable "r = j". Likewise, if the letter "i+1" stored in l(1) and the letter from e(j,0)  #
'# are the same then variable "c = j". Variable "r" represents the rows of matrix "m", whereas     #
'# variable "c" represents the columns of matrix "m" (m(r, c)).                                    #
'# Thus, at each step through "S", an element of matrix "m" is always incremented according to     #
'# the coordinates received from "r" and "c". This "coordinate" approach greatly increases the     #
'# processing speed of the algorithm. The number of loops = (k-1)*d, where "d" represents the      #
'# number of states (or letter types), and "k" is the number of letters in "S". When the letter    #
'# stored in "l(0)" and the letter from "j" row in matrix "e" are the same, the second column of   #
'# matrix "e" is also incremented. The second column of matrix "e" stores the number of            #
'# appearances for each type of letter in "S".                                                     #
'#_________________________________________________________________________________________________#
'# In the fourth phase, the counts from matrix "m" elements are divided by the counts from the     #
'# second column of matrix "e". The result of this division is stored in the same position in      #
'# matrix "m", and represents a transition probability.                                            #
'#_________________________________________________________________________________________________#
'#                                                                                                 #
'# Special considerations:                                                                         #
'#                                                                                                 #
'# If a state at the end of "S" (ie HAHAAAHQ) does not occur in the rest of "S" then matrix "m"    #
'# will contain a row with all elements on zero. Since it is at the end of "S", the letter does    #
'# not make a transition to anything. If a state from the beginning of "S" (ie. QHAHAAAH) does     #
'# not occur in the rest of "S" then matrix "m" will contain a column with all elements on zero.   #
'# Since the first letter it is only seen at the beginning of "S", no other letter makes a         #
'# transition to it.                                                                               #
'#                                                                                                 #
'# The meaning of variables:                                                                       #
'#      _____________________________________________________________________________________      #
'# S = |The string that is being analyzed.                                                  _|     #
'#      _____________________________________________________________________________________      #
'# q = |It is a flag variable with initial value of 1. The value of q becomes zero only if a |     #
'#     |letter x in the "S" string coresponds with a letter y in the "a" string.            _|     #
'#      _____________________________________________________________________________________      #
'# a = |The variable that holds the letters representing the states. The variable gradually  |     #
'#     |increases in length as the "S" string is analyzed. At each loop, a new letter is     |     #
'#     |added to variable "a" only if the value of q becomes zero. Thus, at the end of the   |     #
'#     |first loop the number of letters in the variable is equal to the total number        |     #
'#     |of states.                                                                          _|     #
'#      _____________________________________________________________________________________      #
'# d = |Represents the total number of states and is the length of "a" variable.            _|     #
'#      _____________________________________________________________________________________      #
'# m = |The main probability matrix which the function produces.                            _|     #
'#      _____________________________________________________________________________________      #
'# k = |Represents the length of the "S" string.                                            _|     #
'#      _____________________________________________________________________________________      #
'# e = |It is a matrix with two columns, namely column 0 and 1. Column 0 stores all the      |     #
'#     |letters found in "a". Column 1 stores the number of appearances for each type        |     #
'#     |of letter in "S".                                                                   _|     #
'#      _____________________________________________________________________________________      #
'# l = |Is a vector with two components. Vector "l" contains the "i" and "i+1" letters       |     #
'#     |from "S".                                                                           _|     #
'#                                                                                                 #
'###################################################################################################

Private Sub MakeMatrix_Click()
    Discrete_Probability_Detector (InP.Text)
End Sub

Function Discrete_Probability_Detector(ByVal S As String)

    Dim e() As String
    Dim m() As String
    Dim l(0 To 1) As String
    
    k = Len(S)
    w = 1
    
    For i = 1 To k
        q = 1
        For j = 0 To Len(a)
            x = Mid(S, i, 1)
            y = Mid(a, j + 1, 1)
            If x = y Then q = 0
        Next j
        If q = 1 Then a = a & x
    Next i

    d = Len(a)

    ReDim e(w To d, 0 To 1) As String
    ReDim m(w To d, w To d) As String
    
    For i = w To d
        For j = w To d
          m(i, j) = 0
          If j = w Then
            e(i, 0) = Mid(a, i, 1)
            e(i, 1) = 0
          End If
        Next j
    Next i

    For i = 1 To k - 1
        l(0) = Mid(S, i, 1)
        l(1) = Mid(S, i + 1, 1)
        For j = w To d
            If l(0) = e(j, 0) Then
               e(j, 1) = Val(e(j, 1)) + 1
               r = j
            End If
            If l(1) = e(j, 0) Then c = j
        Next j
        m(r, c) = Val(m(r, c)) + 1
    Next i
    
    tmp = "S=" & S & vbCrLf & vbCrLf
    tmp = tmp & "The algorithm detected a total of " & (d - w + 1) & " states." & vbCrLf & vbCrLf
    tmp = tmp & MatrixPaint(w, d, m, a, "(C)", "Count:") & vbCrLf
    
    For i = w To d
        For j = w To d
            If Val(e(i, 1)) > 0 Then
            m(i, j) = Val(m(i, j)) / Val(e(i, 1))
            End If
        Next j
    Next i

    tmp = tmp & MatrixPaint(w, d, m, a, "(P)", "Transition matrix M:")

    OutPut.Text = tmp

End Function


Function MatrixPaint(w, d, ByVal m As Variant, a, n, ByVal msg As String) As String
    
    Dim e() As String
    ReDim e(1 To d) As String
    
    d = Len(a)
    q = "|     "
    h = "|_____|"
    l = vbCrLf
    
    For i = (w - 1) To d
        If i = (w - 1) Then t = t & l & "."
        t = t & "_____."
        If i = d Then t = t & l & "| " & n & " |  "
    Next i

    For i = w To d
        e(i) = Mid(a, i, 1)
        t = t & e(i) & "  |  "
        h = h & "_____|"
    Next i
    
    t = t & l & h & l
    
    For i = w To d
        For j = w To d
            v = Round(m(i, j), 2)
            u = Mid(q, 1, Len(q) - Len(v))
            If j = d Then o = "|" Else o = ""
            For b = w To d
                If j = w And i = b Then
                    t = t & "|  " & e(i) & "  "
                End If
            Next b
            t = t & u & v & o
        Next j
    t = t & l & h & l
    Next i
    
    MatrixPaint = msg & " M[" & Val(d - w + 1) & "," & Val(d - w + 1) & "]" & l & t & l
    
End Function


Private Sub Form_Resize()
    If DPD.ScaleWidth > 0 Then
        OutPut.Width = DPD.ScaleWidth - OutPut.Left - 10
        OutPut.Height = DPD.ScaleHeight - OutPut.Top - 10
    End If
End Sub

Source: Gagniuc, Paul A. (2017). Markov Chains: From Theory to Implementation and Experimentation. USA, NJ: John Wiley & Sons. pp. 1–235. ISBN 978-1-119-38755-8.


Other sources:

1. https://sites.google.com/view/text-to-transition-matrix/

2. https://www.statisticsviews.com/details/feature/10822963/Markov-Chains-From-Theory-to-Implementation-and-Experimentation-An-interview-wit.html

3. https://www.wiley.com/en-gb/Markov+Chains%3A+From+Theory+to+Implementation+and+Experimentation-p-9781119387558

4. https://transition-matrix.blogspot.com/

Fast kernel

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Copyright (c) 2009, Sergey Bochkanov (ALGLIB project).
'
'>>> SOURCE LICENSE >>>
'This program is free software; you can redistribute it and/or modify
'it under the terms of the GNU General Public License as published by
'the Free Software Foundation (www.fsf.org); either version 2 of the
'License, or (at your option) any later version.
'
'This program is distributed in the hope that it will be useful,
'but WITHOUT ANY WARRANTY; without even the implied warranty of
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'GNU General Public License for more details.
'
'A copy of the GNU General Public License is available at
'http://www.fsf.org/licensing/licenses
'
'>>> END OF LICENSE >>>
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Routines
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Fast kernel
'
'  -- ALGLIB routine --
'     19.01.2010
'     Bochkanov Sergey
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function CMatrixRank1F(ByVal M As Long, _
         ByVal N As Long, _
         ByRef A() As Complex, _
         ByVal IA As Long, _
         ByVal JA As Long, _
         ByRef U() As Complex, _
         ByVal IU As Long, _
         ByRef V() As Complex, _
         ByVal IV As Long) As Boolean
    Dim Result As Boolean

    Result = False

    CMatrixRank1F = Result
End Function


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Fast kernel
'
'  -- ALGLIB routine --
'     19.01.2010
'     Bochkanov Sergey
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function RMatrixRank1F(ByVal M As Long, _
         ByVal N As Long, _
         ByRef A() As Double, _
         ByVal IA As Long, _
         ByVal JA As Long, _
         ByRef U() As Double, _
         ByVal IU As Long, _
         ByRef V() As Double, _
         ByVal IV As Long) As Boolean
    Dim Result As Boolean

    Result = False

    RMatrixRank1F = Result
End Function


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Fast kernel
'
'  -- ALGLIB routine --
'     19.01.2010
'     Bochkanov Sergey
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function CMatrixMVF(ByVal M As Long, _
         ByVal N As Long, _
         ByRef A() As Complex, _
         ByVal IA As Long, _
         ByVal JA As Long, _
         ByVal OpA As Long, _
         ByRef X() As Complex, _
         ByVal IX As Long, _
         ByRef Y() As Complex, _
         ByVal IY As Long) As Boolean
    Dim Result As Boolean

    Result = False

    CMatrixMVF = Result
End Function


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Fast kernel
'
'  -- ALGLIB routine --
'     19.01.2010
'     Bochkanov Sergey
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function RMatrixMVF(ByVal M As Long, _
         ByVal N As Long, _
         ByRef A() As Double, _
         ByVal IA As Long, _
         ByVal JA As Long, _
         ByVal OpA As Long, _
         ByRef X() As Double, _
         ByVal IX As Long, _
         ByRef Y() As Double, _
         ByVal IY As Long) As Boolean
    Dim Result As Boolean

    Result = False

    RMatrixMVF = Result
End Function


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Fast kernel
'
'  -- ALGLIB routine --
'     19.01.2010
'     Bochkanov Sergey
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function CMatrixRightTRSMF(ByVal M As Long, _
         ByVal N As Long, _
         ByRef A() As Complex, _
         ByVal I1 As Long, _
         ByVal J1 As Long, _
         ByVal IsUpper As Boolean, _
         ByVal IsUnit As Boolean, _
         ByVal OpType As Long, _
         ByRef X() As Complex, _
         ByVal I2 As Long, _
         ByVal J2 As Long) As Boolean
    Dim Result As Boolean

    Result = False

    CMatrixRightTRSMF = Result
End Function


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Fast kernel
'
'  -- ALGLIB routine --
'     19.01.2010
'     Bochkanov Sergey
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function CMatrixLeftTRSMF(ByVal M As Long, _
         ByVal N As Long, _
         ByRef A() As Complex, _
         ByVal I1 As Long, _
         ByVal J1 As Long, _
         ByVal IsUpper As Boolean, _
         ByVal IsUnit As Boolean, _
         ByVal OpType As Long, _
         ByRef X() As Complex, _
         ByVal I2 As Long, _
         ByVal J2 As Long) As Boolean
    Dim Result As Boolean

    Result = False

    CMatrixLeftTRSMF = Result
End Function


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Fast kernel
'
'  -- ALGLIB routine --
'     19.01.2010
'     Bochkanov Sergey
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function RMatrixRightTRSMF(ByVal M As Long, _
         ByVal N As Long, _
         ByRef A() As Double, _
         ByVal I1 As Long, _
         ByVal J1 As Long, _
         ByVal IsUpper As Boolean, _
         ByVal IsUnit As Boolean, _
         ByVal OpType As Long, _
         ByRef X() As Double, _
         ByVal I2 As Long, _
         ByVal J2 As Long) As Boolean
    Dim Result As Boolean

    Result = False

    RMatrixRightTRSMF = Result
End Function


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Fast kernel
'
'  -- ALGLIB routine --
'     19.01.2010
'     Bochkanov Sergey
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function RMatrixLeftTRSMF(ByVal M As Long, _
         ByVal N As Long, _
         ByRef A() As Double, _
         ByVal I1 As Long, _
         ByVal J1 As Long, _
         ByVal IsUpper As Boolean, _
         ByVal IsUnit As Boolean, _
         ByVal OpType As Long, _
         ByRef X() As Double, _
         ByVal I2 As Long, _
         ByVal J2 As Long) As Boolean
    Dim Result As Boolean

    Result = False

    RMatrixLeftTRSMF = Result
End Function


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Fast kernel
'
'  -- ALGLIB routine --
'     19.01.2010
'     Bochkanov Sergey
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function CMatrixSYRKF(ByVal N As Long, _
         ByVal K As Long, _
         ByVal Alpha As Double, _
         ByRef A() As Complex, _
         ByVal IA As Long, _
         ByVal JA As Long, _
         ByVal OpTypeA As Long, _
         ByVal Beta As Double, _
         ByRef C() As Complex, _
         ByVal IC As Long, _
         ByVal JC As Long, _
         ByVal IsUpper As Boolean) As Boolean
    Dim Result As Boolean

    Result = False

    CMatrixSYRKF = Result
End Function


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Fast kernel
'
'  -- ALGLIB routine --
'     19.01.2010
'     Bochkanov Sergey
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function RMatrixSYRKF(ByVal N As Long, _
         ByVal K As Long, _
         ByVal Alpha As Double, _
         ByRef A() As Double, _
         ByVal IA As Long, _
         ByVal JA As Long, _
         ByVal OpTypeA As Long, _
         ByVal Beta As Double, _
         ByRef C() As Double, _
         ByVal IC As Long, _
         ByVal JC As Long, _
         ByVal IsUpper As Boolean) As Boolean
    Dim Result As Boolean

    Result = False

    RMatrixSYRKF = Result
End Function


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Fast kernel
'
'  -- ALGLIB routine --
'     19.01.2010
'     Bochkanov Sergey
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function RMatrixGEMMF(ByVal M As Long, _
         ByVal N As Long, _
         ByVal K As Long, _
         ByVal Alpha As Double, _
         ByRef A() As Double, _
         ByVal IA As Long, _
         ByVal JA As Long, _
         ByVal OpTypeA As Long, _
         ByRef B() As Double, _
         ByVal IB As Long, _
         ByVal JB As Long, _
         ByVal OpTypeB As Long, _
         ByVal Beta As Double, _
         ByRef C() As Double, _
         ByVal IC As Long, _
         ByVal JC As Long) As Boolean
    Dim Result As Boolean

    Result = False

    RMatrixGEMMF = Result
End Function


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Fast kernel
'
'  -- ALGLIB routine --
'     19.01.2010
'     Bochkanov Sergey
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Function CMatrixGEMMF(ByVal M As Long, _
         ByVal N As Long, _
         ByVal K As Long, _
         ByRef Alpha_ As Complex, _
         ByRef A() As Complex, _
         ByVal IA As Long, _
         ByVal JA As Long, _
         ByVal OpTypeA As Long, _
         ByRef B() As Complex, _
         ByVal IB As Long, _
         ByVal JB As Long, _
         ByVal OpTypeB As Long, _
         ByRef Beta_ As Complex, _
         ByRef C() As Complex, _
         ByVal IC As Long, _
         ByVal JC As Long) As Boolean
    Dim Result As Boolean
    Dim Alpha As Complex
    Dim Beta As Complex
    Alpha = Alpha_
    Beta = Beta_

    Result = False

    CMatrixGEMMF = Result
End Function