#Python – #FastAPI Webserver sharing information from values in a different thread

Buy Me A Coffee

Hi !

After my yesterday post using Flask, I was sure that a FastAPI version will be needed, so here it goes:

I have a common scenario which involves:

  • A sensor collecting information
  • A web-server publishing the sensor information

Read my previous posts to understand why I think this is the simple way to solve this: Multi-threading.

  • Thread 1, where an infinite loop request information from the sensor, and stores the latest value to be shared.
  • Thread 2, where a web-server process requests and share the latest sensor information.

Easy ! And after a couple of tests, I manage to create a single file implementing this:

So at this point, you may think: why does El Bruno need this? So, let’s share an image that I’ll use in future posts:

thermal camera demo

Happy coding!

Greetings

El Bruno

Resources

#Python – Flask Webserver sharing information from values in a different thread

Buy Me A Coffee

Hi !

I have a common scenario which involves:

  • A sensor collecting information
  • A web-server publishing the sensor information

This is simple, however the sensor does not support constants requests, and it may return a “too many requests” response when called directly. The idea to get the sensor information directly in the web-request was not valid from day zero.

I asked for support / guidance and my amazing and smart friends show me the concept of OVER ENGINEERING. Dockers, Compose, Queues, Coordination and more was part of some of the proposals. However, they also show me the most easy and simple way to solve this: Multi-threading.

  • Thread 1, where an infinite loop request information from the sensor, and stores the latest value to be shared.
  • Thread 2, where a web-server process requests and share the latest sensor information.

Easy ! And after a couple of tests, I manage to create a single file implementing this:

So at this point, you may think: why does El Bruno need this? So, let’s share an image that I’ll use in future posts:

thermal camera demo

Note: Some very smart people also suggested to implements this using FastAPI instead of Flask, so a future post may include this.

Happy coding!

Greetings

El Bruno

Resources

[SevillaDotNet] Caf√© Virtual con Bruno Capuano

Tomorrow I’ll be having a great time with some Sevilla friends ūüėÄ

Javier Su√°rez | Blog

Café Virtual

Los caf√©s virtuales consisten en una reuni√≥n por streaming donde tendremos un caf√© y charla con un invitado especial. De una forma amena y divertida hablaremos con invitados acerca de tecnolog√≠as .NET, los conoceremos mejor, etc. Adem√°s, tendremos tiempo para conocer tambi√©n mejor al invitado usando algun que otro ‚Äújuego‚ÄĚ adem√°s de permitir la participaci√≥n de cualquiera que quiera conectar y participar en ronda de preguntas, etc.

Café Virtual

Bruno Capuano

En esta ocasión tendremos un nuevo café virtual con Bruno Capuano. Hablaremos por supuesto de tecnologías Microsoft centrados en inteligencia artificial, de su podcast y lo conoceremos un poquito mejor.

Bruno Capuano

Será el próximo Sábado, 04 de Julio de 12:00h a 14:00h (GMT+1).

¬ŅTe apuntas?

Más información

View original post

#Office – New Microsoft Word editor helps support Inclusive Language.

Buy Me A Coffee

Hi!

I already write about some cool features embedded in Office to help us to be more productive. These features are mostly based on Artificial Intelligence. And one great example is the Microsoft Word Editor feature.

Today I was reading an article “New AI tools help writers be more clear, concise and inclusive in Office and across the web” (see references) , and I realize that the Microsoft Word Editor focus not only on productivity, it also help us to fight bias and to be more inclusive while we are writing.

Important: this feature is not enabled by default. In order to enable this, we must follow these steps “

  • Open Word Options
  • Select Proofing section
  • Go to [When correcting spelling …. / Writing Style] option
  • Open Settings
  • Enable the [Inclusiveness] options
enable Inclusiveness options in Microsoft Word

Once we enable these features, the editor will start to analyze for age bias, cultural bias, and more.

I’ve tested this, and it’s nice to get suggestions based on gender bias, like use firefighter instead of fireman.

suggestion change fireman by firefighter

It also suggest other options if we are using “whitelist”

suggestion, do not use whitelist

In the references sections, I shared 2 amazing articles where Microsoft explains the details about this feature.

And, in the personal side, this is also a great tool for non-english speakers like myself, to learn Inclusiveness and also to do a better work.

Super cool !

Happy coding!

Greetings

El Bruno

References

#SomeGoodNews: Reminder, less than 24 hr for Talk 4 Kids 2020. #t4k2020 @talks4kids

Buy Me A Coffee

Hi !

Let’s share Some Good News.

Before moving to Canada, my last event in Spain was probably one of the the best one ever: with a couple of friends we hosted the Talk 4 Kids.

Talk 4 Kids

The event is focused on technology, with amazing speakers, and the funds raised will go entirely to an NGO or foundation, which has programs and actions focused on children (see Theodora Foundation below).

In 2015 we set ourselves a goal of ‚ā¨ 1,500.00. If we managed to reach this figure, all the speakers would give their talks in disguise. Luckily for everyone and unfortunately for the speakers, we raised ‚ā¨ 1,895, dressed up …. you can still find these images / photos in internet.

This year, we will have an online version, with tons of surprises and you have 2 ways to collaborate / donate:

The speaker lineup is almost ready, and the agenda will be released soon. So, if you want to share some smiles with kids, this is an amazing opportunity to be part of something amazing.

Theodora Foundation

At the Theodora Children’s Charity we believe that all children deserve laughter. The mission at the heart of our work is to contribute to the wellbeing of children in hospitals, hospices and specialist care centres by providing visits from professional performers who have been trained to work in a medical environment.

Our Giggle Doctors visit children in hospitals, hospices and specialist care centres across England. By combining music, play, magic and storytelling these professional performers bring magical moments to brave children in challenging times. We believe that every sick or disabled child should get the giggles that only a Giggle Doctor can bring.

Although a Giggle Doctor visit may only last a few minutes, the effect it can have on a child can last a lifetime. The visits often have a lasting impact on the children and families they visit. We often receive feedback from parents telling us the visits have helped to improve a child’s long-term experience of hospital.

“Because of the Giggle Doctors my daughter actually looks forward to coming to hospital for chemotherapy”

“The Giggle Doctor visits have helped my son to interact as he has developed a phobia of medical staff and the Giggle Doctors have helped him be less scared of people on the ward”

A Giggle Doctor visit isn’t just about one magical moment, it can have a significant and lasting impact on a child’s well-being and perception of the hospital environment. 

Happy coding!

Greetings

El Bruno

#Podcast – NTN 57 – DevOps, GitHub Actions, cultura de DevOps, estrategias de despliegues y mucho m√°s! @snavarropino @jc_quijano,

Buy Me A Coffee
Screen shot of podcast recording

Buenas!

Hoy tenemos la suerte de hablar con Sergio Navarro Pino (@snavarropino) y Juan Carlos Quijano (@jc_quijano) sobre varios temas interesantes. Empezamos hablando de DevOps, orientado a experiencias y cultura. Como somos muy frikis obviamente terminado hablando de Azure DevOps, GitHub Actions, estrategias de Testing, Blue / Green deployments y mucho m√°s!

Speakers

  • Sergio Navarro Pino es Tech Lead en Analyticalways (LinkedIn)
  • Juan Quijano es Microsoft Certified Trainer, Arquitecto de Soluciones en Azure, Consultor independiente en implantaci√≥n de DevOps (LinkedIn)
  • Bruno Capuano es Canada Innovation Lead at Avanade and Microsoft AI MVP (LinkedIn)

Ir a descargar

Happy coding!

Greetings

El Bruno

#Python – Update all Python Packages using pip with #PowerShell

Buy Me A Coffee

Hi !

Here is a small script that I always go back to search in my notes. I found this on internet sometime ago, and is the easiest way to update all packages in a specific environment using pip and PowerShell:

pip freeze | %{$_.split('==')[0]} | %{pip install --upgrade $_}

Depending on your environment, it may take some time. The output is cool, your packages are updated !

Happy coding!

Greetings

El Bruno

#Podcast – NTN 56 – Azure Functions, experiencias de lenguajes de programaci√≥n, el estado de Agile y m√°s @panicoenlaxbox @jc_quijano,

Buy Me A Coffee

Buenas!

Hoy tenemos la suerte de hablar con Sergio Leon (@panicoenlaxbox) y Juan Carlos Quijano (@jc_quijano) sobre varios temas interesantes. Comenzamos hablando de Azure Functions, donde vi que mucho que aprender al respecto. Y después tocamos varios temas, como por ejemplo: la importancia de la calidad en la programación, el estado de Agile, experiencias con diferentes lenguajes de programación y mucho más!

Speakers

  • Sergio Navarro Pino es Tech Lead en Analyticalways (LinkedIn)
  • Juan Quijano es Microsoft Certified Trainer, Arquitecto de Soluciones en Azure, Consultor independiente en implantaci√≥n de DevOps (LinkedIn)
  • Bruno Capuano es Canada Innovation Lead at Avanade and Microsoft AI MVP (LinkedIn)

Ir a descargar

Happy coding!

Greetings

El Bruno

#event – #GlobalAI On Tour Toronto, on Saturday June 27, let’s rock a full morning about AI

Buy Me A Coffee

Hi !

The Global AI On Tour is a free event organized across the world in April, May and June by local communities that are passionate about artificial intelligence on Microsoft Azure.

We will run this in Virtual mode, so for our local one, the one for the Great Toronto Area, we are going to have speakers from all over the world !!!

Registration: https://www.meetup.com/metrotorontoug/events/267885516/

Agenda

https://sessionize.com/api/v2/tti45lz7/view/GridSmart?preview=True

9:30 – 9:45
Introduction and Opening

9:45 – 10:35
Computer, make it so! by Veronika Kolesnikova

10:40 – 11:30
Make your Mixed Reality App include AI with Cognitive Services by Ivana Tilca

11:35 – 12:25
AI and Cognitive Services in Power BI by Ashraf Ghonaim

Happy coding!

Greetings

El Bruno