How to use callbacks to set State in React? – #13

Welcome to Learning at Lambert Labs session #13. This week, Guy King, explains how React updates State asynchronously in a component.

In Today’s Learning Session:

  • What is State in a React component?
  • useState hook in React 16+
  • Callbacks for setting State
  • Why use callbacks?
  • Normal case vs. unexpected case with setTimeout
  • When should you bother with callbacks for asynchronous updates to State
  • Q&A from our developers!

🔊 Subscribe to our channel for weekly learning sessions! https://www.youtube.com/channel/UCi7G5sY0IWqSNUMnRptuJmw

If you’re interested in how Lambert Labs might use React or other web app technologies, check out our Portfolio!

How to use asyncio in Python to achieve concurrency? — #12

Welcome to Learning at Lambert Labs session #12. This week, Rafiq Hilali, takes us asyncio, part of the Python standard library, and how you can use it to achieve concurrency with asynchronous coroutines.

In Today’s Learning Session:

  • Different types of concurrency (threading, multiprocessing, asynchronous coroutines).
  • What are asynchronous coroutines?
  • When should you use asyncio?
  • Demo using app that uses IP address to find local weather
  • aiohttp client framework for asynchronous requests.
  • asynchronous vs. synchronous.

🔊 Subscribe to our channel for weekly learning sessions! https://www.youtube.com/channel/UCi7G5sY0IWqSNUMnRptuJmw

Like and comment on our other videos and posts and if you find want to learn more about Python, check out our Python page!

How to automatically type annotate your Python code? – #11

Welcome to Learning at Lambert Labs session #11. This week, our founder George Lambert, takes us through the runtime typing checking with MonkeyType (made by Instagram) and how you can use it to make your code more readable.

MonkeyType

In Today’s Learning Session:

  • History of dynamic and static typing in Python
  • Argument names, docstrings and the typing modules
  • Problem: old legacy code is hard to type
  • Solution: use MonkeyType to generate typing stubs or even annotate your code.
  • Example usage and demo
  • Q&A from our developers – how does MonkeyType deal with more generic or abstract types?

🔊 Subscribe to our channel for weekly learning sessions! https://www.youtube.com/channel/UCi7G5sY0IWqSNUMnRptuJmw

Like and comment on our other videos and posts and if you find adding Type Annotations in Python interesting, check out our Python page!

How to generate code using Machine Learning? – Learning at Lambert Labs #10

Welcome to Learning at Lambert Labs session #10. This week, Tom Schafer shows us how to train machine learning models on language and actually produce code snippets using trained neural networks.

In Today’s Learning Session:

  • Quick breakdown of neural networks, deep learning and transformers
  • What are language models?
  • Demonstration of language model using Keras library
  • Training and testing the model using Django docs
  • OpenAI GPT3 trained model introduction from OpenAPI
  • GPT3’s own news article
  • Code generation: Python, React, SQL
  • Industry disrupting / ethics of machine learning?
  • Q&A from our developers

🔊 Subscribe to our channel for weekly learning sessions! https://www.youtube.com/channel/UCi7G5sY0IWqSNUMnRptuJmw

Like and comment on our other videos and posts and if you find Machine Learning in Python interesting, check out our Python page!

How to use C from Python? — Learning at Lambert Labs #9

Welcome to Learning at Lambert Labs session #9. This week, Amelia Crowther, explains how to use pre-existing C code from Python modules.

In Today’s Learning Session:

  • Reasons to use C code from Python (old legacy apps, performance, access to the C standard library)
  • Two methods: ctypes and creating a C extension
  • Demo using ctypes
  • ctype function annotations
  • Creating a C extension module
  • Demo using setup.py to create a C extension
  • Q&A from our developers!

If you want to learn more about the software we build using Python, check out our Python page.

🔊 Subscribe to our channel for weekly learning sessions! https://www.youtube.com/channel/UCi7G5sY0IWqSNUMnRptuJmw

How to use Cython? — Learning at Lambert Labs #8

Welcome to Learning at Lambert Labs session #8. This week, Aaron Elijah gives an introduction to using the Cython project to overcome bottlenecks in Python applications.

In Today’s Learning Session:

  • CPython PyObjects.
  • Machine code vs. Bytecode.
  • Python garbage collection and CPU caching.
  • Introduction to Cython programming language.
  • Advantages of Cython vs. Python
  • Demo with Flask and Mandelbrot sets.
  • Profiling Cython and adding static types.

Learn more about how we optimise real-world applications on our Python page.

🔊 Subscribe to our channel for weekly learning sessions! https://www.youtube.com/channel/UCi7G5sY0IWqSNUMnRptuJmw

How to make decentralised apps with Ethereum? — Learning at Lambert Labs #7

Welcome to Learning at Lambert Labs session #7. This week, Ramin Tawab gives an introduction to the first steps of making a decentralised app using the Ethereum blockchain.

In Today’s Learning Session:

  • Client-Server model.
  • Decentralised model.
  • What is a Blockchain?
  • How all regular Web API requests and messages are eventually handled by the backend server.
  • Ethereum blockchain (gas and transactions per blocks).
  • Overview of local development tools including Ganache , Metamask and Truffle
  • Example with simple messenger app
  • Q&A from our developers.

🔊 Subscribe to our channel for weekly learning sessions! https://www.youtube.com/channel/UCi7G5sY0IWqSNUMnRptuJmw

Why did Slack go down in Jan 2021 — Learning at Lambert Labs #6

Welcome to Learning at Lambert Labs session #6. This week, Tom Kobialka, takes us through how the popular business communication platform, Slack, suffered a disastrous outage on 4th Jan 2021 and what could have been done to prevent it.

In Today’s Learning Session:

  • The origins of the Slack outage on 4th Jan 2021 and the ensuing twitter storm.
  • Deep dive into how Slack’s app architecture works.
  • Websocket connection of clients to a message server.
  • How all regular Web API requests and messages are eventually handled by the backend server.
  • The explosive growth of Slack.
  • Slack vs. quota limits and their solution.
  • AWS VPC Peering and Transit Gateway.
  • The timeline of the outage.
  • Analysis of blame: Slack vs. AWS.
  • Q&A from our developers.

🔊 Subscribe to our channel for weekly learning sessions! https://www.youtube.com/channel/UCi7G5sY0IWqSNUMnRptuJmw

How to use Docker as your Python Virtual Environment? — Learning at Lambert Labs #5

Welcome to another Learning at Lambert Labs session. Each week we release videos, presented by our developers, giving quick lectures on a chosen topic in technology.

This week’s presenter is Guy King and his presentation takes us through a simple demo of how to use a Docker container as your Python virtual environment in your project.

In Today’s Learning Session:

  • What’s wrong with existing Python virtual environment setups?
  • Pros of using Docker.
  • Cons of using Docker.
  • Example repo with Docker virtual environment.
  • Customisation and hot loading.
  • Add a user inside running Docker container.
  • Q&A from our developers.

📖 Slides: https://docs.google.com/presentation/d/1Ywj9Tt1OrCFwUsAV0Nz8covzWHb-uoVTcgIlYex-qcM/edit?usp=sharing

To learn more about our development practices using Python and Docker, have a look at out Python page.

🔊 Subscribe to our channel for weekly learning sessions! https://www.youtube.com/channel/UCi7G5sY0IWqSNUMnRptuJmw

Our engagement aims to be conversational and developers are encouraged to ask questions to expand on the ideas that they heard. Each presenter has the freedom to choose whatever topic they wish, as long as it is within a genre of technology or computer science. We are a Python development agency at heart, but that doesn’t stop us showing off our strong computer literacy and broad technical knowledge!

What is OpenCL? — Learning at Lambert Labs #4

Welcome to another Learning at Lambert Labs session. Every week, we release videos, presented by our developers, giving quick lectures on a chosen topic in technology.

This week’s presenter is Amelia Crowther and her presentation takes us through programming a GPU using OpenCL and how you can use it to improve performance for mathematical operations.

In Today’s Learning Session:

  • Overview of GPUs.
  • General purpose programming on GPUs.
  • OpenCL vs. vendor-specific frameworks.
  • How OpenCL allows you to interface and program GPUs.
  • OpenCL tasks.
  • OpenCL vs. Python on CPU.
  • Quick Q&A from our developers.

📖 Slides: https://docs.google.com/presentation/d/1w39YFjE97t2t7f_OmSmspu9llawhnFtXwjtlx3ksK4A/edit?usp=sharing

🤖 Code: https://drive.google.com/drive/folders/1JqRImybjafnVMqC3vIR_i5giDmQbFIBh?usp=sharing

🔊 Subscribe to our channel for weekly learning sessions! https://www.youtube.com/channel/UCi7G5sY0IWqSNUMnRptuJmw

Our engagement aims to be conversational and developers are encouraged to ask questions to expand on the ideas that they heard. Each presenter has the freedom to choose whatever topic they wish, as long as it is within a genre of technology or computer science. We are a Python development agency at heart, but that doesn’t stop us showing off our strong computer literacy and broad technical knowledge!