Rust: Programming language for safety and speed

Introduction Rust is a non-garbage collected, compiled systems programming language with strong typing. It began as a personal project by a Mozilla research employee in 2006, and later, Mozilla started sponsoring the project in 2009. Eventually, Mozilla adopted Rust for Firefox and rewrote the core in Rust in 2017. Rust is an advanced language with numerous features that developers appreciate. Positioned as a compelling alternative to C/C++, Rust offers robust capabilities for system-level programming....

February 7, 2024

Zephyr RTOS: Taking Your Embedded Projects to the Next Level

what is Zephyr? Zephyr RTOS is a game-changing technology developed by experts with decades of collective experience in the embedded world. Originally created as Rocket by Wind River Systems in 2015 and later rebranded as Zephyr, this open-source project has gained immense popularity since its inception. As an open-source project, anyone can access the source code and understand its internal workings. Over the years, Zephyr has garnered a lot of attention from major tech giants like Google, Meta, Intel, and many more, resulting in significant investments in the project....

March 24, 2023

How to implement command design pattern in python?

import abc class CalcCmdAbs(metaclass=abc.ABCMeta): def __init__(self, *args, **kwargs): self._args = args self._kwargs = kwargs @property @abc.abstractmethod def name(self): raise NotImplemented() def execute(self): raise NotImplemented() from .interface import CalcCmdAbs OPERATORS = list() def register_operator(cls): OPERATORS.append(cls) return cls @register_operator class AddCmd(CalcCmdAbs): name = "add" def __init__(self, a, b): super().__init__(a, b) self.a = a self.b = b def execute(self): return self.a + self.b @register_operator class SubtractCmd(CalcCmdAbs): name = "subtract" def __init__(self, a, b): super()....

December 8, 2021

How to generate a zip file from given file list (Django)?

import os import shutil from io import BytesIO from zipfile import ZipFile from django.core.files.storage import FileSystemStorage from django.http import HttpResponse from django.conf import settings local_storage = FileSystemStorage() class ZipResponseMixin: def response(self, request, files: list, folder_name: str) -> HttpResponse: """Zip Response Generate a zip file from given file list and return Http response (Force download) :param request: request Object :param files: list of file like objects saved in models :param folder_name: desired folder name :return: """ folder_abs_path = f"{settings....

November 14, 2021