Search This Blog

Wednesday, November 29, 2023

Powerball Statistics

 I had just finished learning R but was annoyed by it. So, in  learning to do Python, and running into so many Python Matplotlab examples, I decided to do it like that. I put the code blob here in github:https://github.com/LesleyPhillips/Powerball.py/blob/main/Powerball-20231004.py

Some takeaways... apparently there are functions for standard deviations and averaging. : )

Here are the results...




This code... 
  • Gets it numbers from 'https://data.ny.gov/api/views/d6yy-54nr/rows.xml?accessType=DOWNLOAD' 
  • It then loops through the XML data into white balls and red balls.
  • Plots the white ball data
  • Plots the red ball data.

You're done!   : )



Friday, September 15, 2023

How to Compile .vb Code

Ever needed to compile some .vb code? Here's how I did it today.



Given a text file called Helloworld.vb with the following content...

Imports System
Module HelloWorld
    Sub Main(args As String())
        Console.WriteLine("Hello World!")
    End Sub
End Module

You can create this file on any path you see fit with any editor Notepad, Notepad++, Atom, VSCode, pick one.  : ) 

For this example I'm using Visual Studio 2022, which look like this...

Visual Studio defaults to creating content in your %userprofile%\source\repos dir. On creating the VB Console project HelloWorld, it saved the source as %userprofile%\source\repos\HelloWorld\HelloWorld\HelloWorld.vb. 

Make sure the latest vbc.exe is on the path.
On My Windows 11 PC it existed in...
C:\Windows\Microsoft.NET\Framework64\v4.0.30319.

With Visual Studio Community Edition 2022, I found it located in C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Roslyn.

Make sure to search and use the on you want to work with.


Start cmd

Issue commands to go to the directory with your source .vb file

>c:
>cd %userprofile%\source\repos\HelloWorld\HelloWorld
>dir

You directory may look like the following...
Visual Studio will also create other legacy elements for managing the code within its environment. For our purposes they are not needed and can be ignored.

Issue the follow commands

>vbc HelloWorld.vb

** Vbc (the older .Net version) will tell you that there is a better method to use called Roslyn which comes automatically with Visual Studio.   

 

If you are using the Roslyn vbc it will look like this...



 
 

>dir

There's our .exe file!   :)

Run HelloWorld

From the cmd prompt issue the command "helloworld"


It works!   : )

You now have a .exe you can use anywhere.