semvec/pypi-packages huggingface dataset:
mysql-on-sockets 0.0.1
A module which helps you access your MYSQL database over local network.
Keywords: python,socket,sockets,mysql,sql,database,server-client,remote user


# mysql_on_sockets

```cmd
pip install mysql_on_sockets
```

Developed by Vedant Barhate (c) 2022

You need basic knowledge of Python And MySQL to use this package.

This package useful when you want to use your MySQL database from one device on other devices.

## Example
### Creating A Server

```python
from mysql_on_sockets import Server

server = Server(server_host='<IPv4 addr>', server_port=9999, db_host='localhost', db_user='root', db_pswd='<user-pswd>', db_name='<database name>')

server.startServer()

# When You Are Done
server.stopServer()
```

### Creating A Client
```python
from mysql_on_sockets import Client

client = Client(host='<IPv4 addr of devide to join>', port=9999)
client.connectClient()

data = askQuery('<SQL-Query>')
print(data)

# When You Are Done
client.closeClient()
```
hhlpy 0.1.0
Prove hybrid programs correct using Hybrid Hoare Logic
Requires Python: >=3.9
Keywords: hhl,hybrid systems,hoare logic

# HHLPy

HHLPy is a formal verification tool for hybrid systems. It is based on an
extension of Hoare logic to hybrid systems called Hybrid Hoare Logic.

## Installation

### Base installation

The base installation of HHLPy does not require Wolfram Engine:
* Install Python 3.9 or higher: https://www.python.org/downloads/.
* Run `pip install hhlpy` or `python -m pip install hhlpy` to install HHLPy.
* Run `python -m hhlpy` to start HHLPy. Your browser should open automatically.
  (If it doesn't, open `http://127.0.0.1:8000/` in your browser.)

### Install Wolfram Engine

To be able to proof more verification conditions, install Wolfram Engine on your system:
* Download Wolfram Engine and install it: https://www.wolfram.com/engine/
* Get a license for Wolfram Engine and activate it.
* If you use the standard installation path, HHLPy should be able to
find it automatically; simply run `python -m hhlpy`.
* If you see the message `Please install Wolfram Kernel ...`, you
need to set the environment variable `WolframKernel` to the path of the file
`WolframKernel` or `WolframKernel.exe` that comes with the Wolfram Engine
installation. Then restart your terminal and run `python -m hhlpy`.
* If you see the line `Socket exception: Socket operation aborted.` in the terminal,
you probably still need to activate your license. 

## First Steps

Click on the file `basic1.hhl` in the list of example files on the left panel. A
file with the following content will open:
```
pre [x >= 0];
x := x+1;
post [x >= 1];
```
This example program has a single instruction: it increases the variable x by 1.
The only precondition is `x >= 0`; the only postcondition is `x >= 1`.
These conditions seem correct: If `x` is at least `0` and increased by `1`, it
is at least `1` afterwards.

On the right side, you see the verification condition panel. It contains a
single verification condition that has been generated from the program:
```
assume:
  x >= 0
show: x + 1 >= 1
```
Click on the button `Verify` to check the verification condition. A green
checkmark appears below the condition. And the counter next to the button
indicates that `1/1` verification conditions have been proved.

Next, add a second instruction to the program that divides x by 2:
```
pre [x >= 0];
x := x+1;
x := x/2;
post [x >= 1];
```
Observe that the verification condition on the right updates automatically.
Click the button `Verify` to verify the new condition. You will see an X mark
indicating that the verification condition could not be verified. Try to adapt
the postcondition to make the verification go through...

Explore the other example files to see more!
tsp-c 0.0.30
A wrapper for c++ to solve the Traveling Salesman Problem
Requires Python: >=3.6

# Package description

A wrapper for c++ to solve the Traveling Salesman Problem

## Installation
`pip install tsp-c`

## Available methods
* Greedy
* Simulated Annealing (SA)
* Particle Swarm Optimization (PSO)
* Ant Colony Optimization (ACO)
* Two-opt Heuristic

## Available functions
	solve_greedy(distance_matrix)
	solve_SA(distance_matrix)
	set_param_SA(C0, Cmin, L0, alpha)
	solve_PSO(distance_matrix)
	set_param_ACO(hconst, alpha, beta, evprate, intsty, nAnt, nItr)
	solve_ACO(distance_matrix)
	solve_two_opt(distance_matrix)
	set_param_PSO(w, c1, c2, maxV, muProb, nPar, nItr)

## Examples
To solve the problem with the Greedy method:

	
	import tsp_c as tsp

	distance_matrix = [
		[0.0, 290.7, 254.9, 172.9],
		[263.6, 0.0, 508.3, 185.0],
		[258.2, 497.1, 0.0, 405.6],
		[136.8, 190.7, 394.8, 0.0]
	]

	sol, distance = tsp.solve_greedy(distance_matrix)
	print("\nSolution from Greedy:")
	print(distance, " ", sol)
	

The solution will be   `(1, 3, 0, 2)` with total distance 1073.8000000000002.

To solve the problem with the Simulated Annealing method, change the code to:

	
	sol, distance = tsp.solve_SA(distance_matrix)
	

To set the parameters of the Simulated Annealing method, use:

	
	tsp.set_param_SA(C0, Cmin, L0, alpha)
	

where
* C0 = Initial temperature (default = 20.0)
* Cmin = Final temperature (default = 0.1)
* L0 = Number of iterations in each temperature (default = 10000)
* alpha = cooling rate (default = 0.9)

For example:

	
	tsp.set_param_SA(10.0, 0.01, 10000, 0.95)
	
	
To set the parameters of the ACO method, use:

	
	tsp.set_param_ACO(hconst, alpha, beta, evprate, intsty, nAnt, nItr)
	

where
* hconst = Heuristic Constant (default = 50.0)
* alpha = Pheromone influence (default = 3, min = 0.0001, max = 10.0)
* beta = Heuristic influence (default = 5, min = 0.0001, max = 10.0)
* evprate = Evaporation Rate (default = 0.05)
* intsty = Pheromone intensity (default = 0.1)
* nAnt = Number of ants (default = 50)
* nItr = Number of iterations (default = 100)

For example:

	
	tsp.set_param_ACO(100.0, 5, 4, 0.1, 0.15, 200, 200)
	

To set the parameters of the PSO method, use:

	
	tsp.set_param_PSO(w, c1, c2, maxV, muProb, nPar, nItr)
	

where
* w = Inertia weight of the particle (default = 1.0)
* c1 = acceleration coefficient for the local best position (default = 2.0)
* c2 = acceleration coefficient for the global best position (default = 2.0)
* maxV = Maximum velocity of the particles (default = 2.0)
* muProb = mutation probability that change the position of a particle (default = 0.05)
* nPar = Number of particles (default = 100)
* nItr = Number of iterations (default = 5000)

For example:

	
	tsp.set_param_PSO(0.8, 1.5, 1.5, 5, 0.1, 200, 1000)
	
	
## Requirement
python >=3.6

## Operating System
Linux

## References
* Janjarassuk, Udom. (2011). A comparison of heuristic approaches to the travelling salesman problem. ICIC Express Letters. 5. 279-283.