analitics

Pages

Showing posts with label news. Show all posts
Showing posts with label news. Show all posts

Tuesday, September 19, 2023

News : Django 5.0 alpha 1 released.

Django 5.0 alpha 1 is now available. It represents the first stage in the 5.0 release cycle and is an opportunity for you to try out the changes coming in Django 5.0.
Django 5.0 brings a deluge of exciting new features which you can read about in the in-development 5.0 release notes.
Now Django 5.0 supports Python 3.10, 3.11, and 3.12.
At that time, you should be able to run your package’s tests using python -Wd so that deprecation warnings appear.
Django 5.0 introduces the concept of a field group, and field group templates.
Database-computed default values
Database generated model field
More options for declaring field choices
New decorators now support wrapping asynchronous
... a lot of features deprecated in 5.0
You can read more on the official website.

Monday, September 18, 2023

News : Amazon free python audible audiobook.

Although Python programming language comes with many learning resources, you can find a lot of free audiobooks on Amazon.
You can try a free trial then you need to pay $14.95 a month after 30 days - cancel online anytime.

Saturday, September 9, 2023

News : Python 3.12.0 release candidate 2 now available.

This new release comes with many improvements for developers.
Here are some of them.
Modules from the standard library are now potentially suggested as part of the error messages displayed by the interpreter ...
NameError: name 'sys' is not defined. Did you forget to import 'sys'?
  • Many large and small performance improvements like - PEP 709;
  • Support for the Linux perf profiler to report Python function names in traces;
  • New type annotation syntax for generic classes - PEP 695;
  • More flexible f-string parsing, allowing many things previously disallowed - PEP 701;
  • Support for the buffer protocol in Python code - PEP 688;
  • A new debugging/profiling API - PEP 669;
  • Support for isolated sub interpreters with separate Global Interpreter Locks - PEP 684;
All PEPs can be found on this GitHub project.

Friday, August 18, 2023

News : Textual - Rapid Application Development.

Textual is a Rapid Application Development framework for Python.
Build sophisticated user interfaces with a simple Python API. Run your apps in the terminal and (coming soon) a web browser!

Saturday, August 12, 2023

News : Colab behavior through runtime .

I would like Google to emphasize more on the development side some elements that work like robots by interfacing with the development side.
Today I worked a little on artificial intelligence and I realized that it doesn't create textgenrnn_weights.hdf5 file for training created with the Python textgenrnn mode.
A solution is to reset the runtime with Ctrl+M and resume running.
They specify RESTART RUNTIME when using Python modules, see:
WARNING: The following packages were previously imported in this runtime:
   [numpy]
You must restart the runtime in order to use newly installed versions.
In this case, with the creation of textgenrnn_weights.hdf5 file, it is more difficult to understand and cannot be seen easily.

Monday, July 10, 2023

News : About my work and one of my websites.

I would like to bring to the attention of those who follow my activity on my websites and appreciate the inability to continue with one of the websites: free-tutorials.org. It is currently hosted on a free host, but I cannot import it 100%, which has led me not to complete it with new posts. The continuation of the activities there, considering the limited time, will be carried out on my blogs with the defined theme with which I started: Linux - Fedora, Graphics, Python, Pygame.
In the meantime, because the host is expensive and until now someone has helped me to host it on his server, it is possible to sell the domain: free-tutorials.org - I receive purchase offers at my personal Yahoo email address catafest@yahoo.com.
Minimum starting price 250 euros, because the domain is old from 2018.

Wednesday, June 14, 2023

News : OSINT - Open Source Intelligence python course.

For those who want to learn Python in order to: 
  • become a really good developer; 
  • to take the exam to get into university; 
  • to be interviewed for a job.
This course omits VERY many important things and sometimes even recommends what could have been called bad practice. There are things that don't matter when writing small automations for everyday OSINT tasks, but are extremely important when creating serious team projects.
You cam see the project on this GhitHub account.

Sunday, June 11, 2023

News : JupyterLab 4.0 released.

The Jupyter contributor community is proud to announce JupyterLab 4.0, the next major release of our full-featured development environment. The package is now available on PyPI and conda-forge. You can upgrade by running pip install --upgrade jupyterlab or conda install -c conda-forge jupyterlab.
You can read more on the official website.

Wednesday, May 24, 2023

Python 3.11.0 : Exo - domain-specific programming language in python.

Exo is a domain-specific programming language that helps low-level performance engineers transform very simple programs that specify what they want to compute into very complex programs that do the same thing as the specification, only much, much faster.
You can find it on GitHub project and on the official webpage.
Let's install it with pip tool:
C:\PythonProjects>mkdir exo-lang_001

C:\PythonProjects>cd exo-lang_001

C:\PythonProjects\exo-lang_001>pip install exo-lang --user
Collecting exo-lang
  Downloading exo_lang-0.0.2-py3-none-any.whl (142 kB)
  ...
Successfully installed PySMT-0.9.5 asdl-0.1.5 asdl-adt-0.1.0 astor-0.8.1 exo-lang-0.0.2 tomli-2.0.1 
yapf-0.33.0 z3-solver-4.12.2.0
Let's test with this default example but using virtual environments
This allow me to install Python packages in an isolated location from the rest of your system instead of installing them system-wide.
C:\PythonProjects\exo-lang_001>pip install virtualenv --user
...
C:\PythonProjects\exo-lang_001>python -m venv venv
C:\PythonProjects\exo-lang_001>venv\Scripts\activate.bat

(venv) C:\PythonProjects\exo-lang_001>python -m pip install -U setuptools wheel
Successfully installed setuptools-67.8.0 wheel-0.40.0

[notice] A new release of pip available: 22.3 -> 23.1.2
[notice] To update, run: python.exe -m pip install --upgrade pip
(venv) C:\PythonProjects\exo-lang_001>python.exe -m pip install --upgrade pip
Requirement already satisfied: pip in c:\pythonprojects\exo-lang_001\venv\lib\site-packages (22.3)
Collecting pip
  Using cached pip-23.1.2-py3-none-any.whl (2.1 MB)
...
Successfully installed pip-23.1.2
(venv) C:\PythonProjects\exo-lang_001>python -m pip install exo-lang
...
Installing collected packages: z3-solver, PySMT, asdl, tomli, numpy, attrs, astor, yapf, asdl-adt, exo-lang
Successfully installed PySMT-0.9.5 asdl-0.1.5 asdl-adt-0.1.0 astor-0.8.1 attrs-23.1.0 exo-lang-0.0.2 numpy-1.24.3
tomli-2.0.1 yapf-0.33.0 z3-solver-4.12.2.0
Let's try a simple example from official webpage:
(venv) C:\PythonProjects\exo-lang_001>notepad example.py
# example.py
from __future__ import annotations
from exo import *

@proc
def example_sgemm(
    M: size,
    N: size,
    K: size,
    C: f32[M, N] @ DRAM,
    A: f32[M, K] @ DRAM,
    B: f32[K, N] @ DRAM,
):
    for i in seq(0, M):
        for j in seq(0, N):
            for k in seq(0, K):
                C[i, j] += A[i, k] * B[k, j]
Use this command and check the out folder:
(venv) C:\PythonProjects\exo-lang_001>cd out
(venv) C:\PythonProjects\exo-lang_001\out>dir 
...
 example.c   example.h
If you want to know more see this video from youtube:

Tuesday, February 14, 2023

News : Colab changes ...

Python 2 is no longer supported in Colab and cells runs iron python.
All information you need on migrating your code from Python 2 to Python 3 can be found on Porting Python 2 Code to Python 3.
You can see these changes on the GitHub project.

Monday, January 2, 2023

News : PyTorch machine learning framework compromised with malicious dependency.

If you installed PyTorch-nightly on Linux via pip between December 25, 2022 and December 30, 2022, please uninstall it and torchtriton immediately, and use the latest nightly binaries (newer than Dec 30th 2022).
Read more on the official website.

Wednesday, December 28, 2022

Python 3.10.2 : Copernicus A.P.I. and python sentinelsat python package - part 001.

Last night I worked a bit with python and tested on the online tool from Copernicus.
Copernicus is the European Union's Earth observation programme, which analyzes our planet and its environment for the benefit of all European citizens.
If you want to test it with python or another A.P>I. you need to create an user and a apassword.This is the source code I used with S:
from sentinelsat import SentinelAPI, read_geojson, geojson_to_wkt
from datetime import date
# Connect to the Sentinel API
api = SentinelAPI('___', '___', 'https://scihub.copernicus.eu/dhus')
#
api.download('___from_copernicus_website___')
# Search for Sentinel-2 images covering a specific area
footprint = geojson_to_wkt(read_geojson('area_of_interest.geojson'))

products = api.query(footprint,
                     date=('20211201', '20211205'),
                     platformname='Sentinel-1')
# convert to Pandas DataFrame
products_df = api.to_dataframe(products)
print(products_df)
# sort and limit to first 5 sorted products
products_df_sorted = products_df.sort_values(['link'], ascending=[True])
products_df_sorted = products_df_sorted.head(5)

# download sorted and reduced products
api.download_all(products_df_sorted.index)
You need a JSOn file to select the area of interest:
After I run this python script, the result is this:
python test001.py
                                                                                  title  ... productconsolidation
8f12995e-8f4b-4634-91bb-4971a1bdd0c3  S1B_IW_SLC__1SDV_20211201T160049_20211201T1601...  ...                  NaN
c62ceac6-c9ac-409d-bea9-d1bc23b1b183  S1B_IW_GRDH_1SDV_20211201T160050_20211201T1601...  ...                  NaN
2d1319c5-60af-468b-904a-5dfbdd5f205c  S1B_IW_RAW__0SDV_20211201T160046_20211201T1601...  ...                SLICE

[3 rows x 36 columns]
Downloading S1B_IW_GRDH_1SDV_20211201T160050_20211201T160115_029834_038FB2_A390.zip: 100%|█| 929M/929M [02:44<00:00, 5.
Downloading products:  33%|██████████████████▋                                     | 1/3 [02:58<05:57, 178.58s/product]
Downloading S1B_IW_RAW__0SDV_20211201T160046_20211201T160119_029834_038FB2_D35D.zip:  83%|▊| 1.31G/1.58G [03:21<00:26,
Downloading S1B_IW_SLC__1SDV_20211201T160049_20211201T160116_029834_038FB2_AC13.zip:  31%|▎| 1.33G/4.35G [03:18<04:16,
...
The copernicus online map can be seen in the next inage:

News : Inkscape team hiring python developer.

For the Inkscape project and its users, interoperability with other software packages, both free and commercial, is of high importance. The PLC has decided to hire a developer for the equivalent of 1.5 months (part-time schedule available) to implement importing functionality of a file format for which Inkscape yet lacks proper support. An extension of the project to up to 3 months (with additional compensation) may be granted depending on the success of the first half ...
You can find more information on the official website.

Tuesday, November 8, 2022

News : Snowpark for Python.

Snowpark for Python, now generally available, empowers the growing Python community of data scientists, data engineers, and developers to build secure and scalable data pipelines and machine learning (ML) workflows directly within Snowflake—taking advantage of Snowflake’s performance, elasticity, and security benefits, which are critical for production workloads., read more on this news on the official blog.
The official website come with this feature: Start your 30-day free Snowflake trial which includes $400 worth of free usage.

Saturday, October 29, 2022

News : PyTorch 1.13 new release.

We are excited to announce the release of PyTorch® 1.13 (release note)! This includes Stable versions of BetterTransformer. We deprecated CUDA 10.2 and 11.3 and completed migration of CUDA 11.6 and 11.7. Beta includes improved support for Apple M1 chips and functorch, a library that offers composable vmap (vectorization) and autodiff transforms, being included in-tree with the PyTorch release. This release is composed of over 3,749 commits and 467 contributors since 1.12.1. We want to sincerely thank our dedicated community for your contributions.
You can find more on the official website.

Wednesday, April 27, 2022

News : Python 3.11 alpha.

This is an old news because on the date Wednesday, April 6, 2022 the alpha version of the well-known python programming language was released.
The last Python 3.11 alpha (3.11.0a7) is available on this webpage.
I install and works good.
C:\Python311alpha>python.exe
Python 3.11.0a7 (main, Apr  5 2022, 21:27:39) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Here are the new features and changes so far:
PEP 657 -- Include Fine-Grained Error Locations in Tracebacks
PEP 654 -- Exception Groups and except*
PEP 673 -- Self Type
PEP 646-- Variadic Generics
PEP 680-- tomllib: Support for Parsing TOML in the Standard Library
PEP 675-- Arbitrary Literal String Type
PEP 655-- Marking individual TypedDict items as required or potentially-missing
bpo-46752-- Introduce task groups to asyncio
The Faster Cpython Project is already yielding some exciting results: 
this version of CPython 3.11 is ~ 19% faster on the geometric mean of the PyPerformance benchmarks, compared to 3.10.0.
It seems that the new changes are very different from the old versions and some are even effective.

Tuesday, January 11, 2022

News : Python as the programming language of 2021.

The TIOBE index is based on the number of search results for a programming language across popular search engines, which is pretty limited.
They say:
Python has won the prestigious TIOBE Programming Language of the Year award. Congratulations! This is the second time in a row. The award is given to the programming language that has gained the highest increase in ratings in one year. C# was on its way to get the title for the first time in history, but Python surpassed C# in the last month.

Sunday, October 10, 2021

News : The new python version 3.10.0.

Almost six days ago, the new version of python was released, version 3.10.0, see this.
Its installation on windows operating systems is done in the same way as the old installations, with the same steps and the same settings.
After installation, I turned it on and tested some of the new features.
C:\Python310>python
Python 3.10.0 (tags/v3.10.0:b494f59, Oct  4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Python 3.10 comes with precise and constructive error messages like:
...
SyntaxError: '{' was never closed
...
>>> foo(a, b for b in range(5), c)
...
    foo(a, b for b in range(5), c)
           ^^^^^^^^^^^^^^^^^^^
SyntaxError: Generator expression must be parenthesized
...
>>> {a, b for (a, b) in zip("a", "b")}
...
    {a, b for (a, b) in zip("a", "b")}
     ^^^^
SyntaxError: did you forget parentheses around the comprehension target?
...
SyntaxError: expected ':'
...
SyntaxError: invalid syntax. Perhaps you forgot a comma?
...
SyntaxError: ':' expected after dictionary key
...
SyntaxError: expected 'except' or 'finally' block
...
SyntaxError: cannot assign to attribute here. Maybe you meant '==' instead of '='?
...
IndentationError: expected an indented block after 'if' statement in line ...
...
>>> import collections
>>> collections.namedtoplo
...
AttributeError: module 'collections' has no attribute 'namedtoplo'. Did you mean: 'namedtuple'?
...
>>> a = 0
>>> aa
...
NameError: name 'aa' is not defined. Did you mean: 'a'?
PEP 634: Structural Pattern Matching Structural 
... the pattern matching is a comprehensive addition to the Python language. 
They tell us: Pattern matching enables programs to extract information from complex data types, branch on the structure of data, and apply specific actions based on different forms of data.
PEP 604: New Type Union Operator as X|Y 
PEP 613: Explicit Type Aliases 
PEP 647: User-Defined Type Guards 
PEP 612: Parameter Specification Variables
You can see more on the official webpage.

Tuesday, January 26, 2021

Python 3.6.0 : Django 3.2 alpha 1 released.

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Built by experienced developers, it takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source. 

I tested it and I was satisfied with the way it works with this framework and it has many good features for the web. 
Django 3.2 is designated as a long-term support release.

Today, Django 3.2 alpha 1 is available with new features.
A good roadmap towards Django 3.2. can be found on this schedule webpage.
As with all alpha and beta packages, this is not for production use.
Django 3.2 supports Python 3.6, 3.7, 3.8, and 3.9. The next release is expected in April 2021, see:
  • January 14, 2021, Django 3.2 alpha; feature freeze;
  • February 18 Django 3.2 beta; non-release blocking bug fix freeze;
  • March 18 Django 3.2 RC 1; translation string freeze;
  • April 6 Django 3.2 final release.

Sunday, August 30, 2020

Python 3.8.5 : Testing with openpyxl - part 002 .

Today I will show you how can use Levenshtein ratio and distance between two strings, see wikipedia.
I used three files created with LibreOffice and save it like xlsx file type.
All of these files come with the column A fill with strings of characters, in this case, numbers.
The script will read all of these files from the folder named xlsx_files and will calculate Levenshtein ratio and distance between the strings of name of these files and column A.
Finally, the result is shown into a graph with matplotlib python package.
Let's see the python script:
import os
from glob import glob

from openpyxl import load_workbook
import numpy as np 
import matplotlib.pyplot as plt 

def levenshtein_ratio_and_distance(s, t, ratio_calc = False):
    """ levenshtein_ratio_and_distance - distance between two strings.
        If ratio_calc = True, the function computes the
        levenshtein distance ratio of similarity between two strings
        For all i and j, distance[i,j] will contain the Levenshtein
        distance between the first i characters of s and the
        first j characters of t
    """
    # Initialize matrix of zeros
    rows = len(s)+1
    cols = len(t)+1
    distance = np.zeros((rows,cols),dtype = int)

    # Populate matrix of zeros with the indeces of each character of both strings
    for i in range(1, rows):
        for k in range(1,cols):
            distance[i][0] = i
            distance[0][k] = k
    for col in range(1, cols):
        for row in range(1, rows):
            # check the characters are the same in the two strings in a given position [i,j] 
            # then the cost is 0
            if s[row-1] == t[col-1]:
                cost = 0 
            else:             
                # calculate distance, then the cost of a substitution is 1.
                if ratio_calc == True:
                    cost = 2
                else:
                    cost = 1
            distance[row][col] = min(distance[row-1][col] + 1,      # Cost of deletions
                                 distance[row][col-1] + 1,          # Cost of insertions
                                 distance[row-1][col-1] + cost)     # Cost of substitutions
    if ratio_calc == True:
        # Ration computation of the Levenshtein Distance Ratio
        Ratio = ((len(s)+len(t)) - distance[row][col]) / (len(s)+len(t))
        return Ratio
    else:
        return distance[row][col]


PATH = "/home/mythcat/xlsx_files/"
result = [y for x in os.walk(PATH) for y in glob(os.path.join(x[0], '*.xlsx'))]
result_files = [os.path.join(path, name) for path, subdirs, files in os.walk(PATH) for name in files]
#print(result)
row_0 = []

for r in result:
    n = 0
    wb = load_workbook(r)
    sheets = wb.sheetnames
    ws = wb[sheets[n]]
    for row in ws.rows:
            if (row[0].value) != None :
                rows = row[0].value
                row_0.append(rows)

print("All rows of column A ")
print(row_0)
files = []
for f in result_files:
    ff = str(f).split('/')[-1:][0]
    fff = str(ff).split('.xlsx')[0]
    files.append(fff)

print(files)
# define tree lists for levenshtein
list1 = []
list2 = []

for l in row_0:
    str(l).lower()
    for d in files:
        Distance = levenshtein_ratio_and_distance(str(l).lower(),str(d).lower())   
        Ratio = levenshtein_ratio_and_distance(str(l).lower(),str(d).lower(),ratio_calc = True)
        list1.append(Distance)
        list2.append(Ratio)
        
print(list1, list2)
# plotting the points  
plt.plot(list1,'g*', list2, 'ro' )
plt.show()
The result is this:
[mythcat@desk ~]$ python test_xlsx.py
All rows of column A 
[11, 2, 113, 4, 1111, 4, 4, 111, 2, 1111, 5, 4, 4, 3, 1111, 1, 2, 1113, 4, 115, 1, 2, 221, 1, 1,
 43536, 2, 34242, 3, 1]
['001', '002', '003']
[2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 3, 4, 4, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 4, 4, 3, 3, 
3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 4, 4, 2, 3, 3, 3, 2, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 
2, 3, 2, 3, 3, 2, 3, 3, 2, 3, 3, 5, 5, 4, 3, 2, 3, 5, 4, 5, 3, 3, 2, 2, 3, 3] [0.4, 0.0, 0.0, 0.0, 
0.5, 0.0, 0.3333333333333333, 0.0, 0.3333333333333333, 0.0, 0.0, 0.0, 0.2857142857142857, 0.0, 0.0,
 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.3333333333333333, 0.0, 0.0, 0.0, 0.5, 0.0, 0.2857142857142857, 0.0,
 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.2857142857142857, 0.0, 0.0, 0.5,
 0.0, 0.0, 0.0, 0.5, 0.0, 0.2857142857142857, 0.0, 0.2857142857142857, 0.0, 0.0, 0.0, 0.3333333333333333,
 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.3333333333333333, 0.3333333333333333, 0.0, 0.5, 0.0, 0.0,
 0.5, 0.0, 0.0, 0.0, 0.0, 0.25, 0.0, 0.5, 0.0, 0.0, 0.25, 0.25, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0]