python

Python Decorators: What is decorators and how to use them?

Python Decorators: What is decorators and how to use them?

Decorators are a powerful and versatile tool that allows you to modify the behavior of functions without permanently altering their original code. They work by wrapping a function in another function, which adds some extra functionality before or after the original function executes. What they are: Decorators are higher-order functions, meaning they take another function as an argument and return a new function. The new function returned by the decorator typically acts as a wrapper around the original function, adding or modifying its behavior. How they work: Defining the Decorator: You create a function that takes another function as its…
Read More
Game Jam Experience();

Game Jam Experience();

A few days before I participated in a jam to showcase my skills and see what other people are building, it was hosted on itch.io a famous place for hosting games and game jams. My Experience: The game jam hosts had given a time period of 10 days to finish a game by either using an engine or a framework.Like always I decided to make a game with pygame and choosing a difficult path for myself which gives more pleasure when completed. I only had last five days due to a work load in the previous days. After thinking a…
Read More
Conquering Your First Database: Essential SQL Queries for Newbies

Conquering Your First Database: Essential SQL Queries for Newbies

Congratulations! You've embarked on the exciting journey of learning SQL, the language that unlocks the secrets hidden within databases. Whether you're a budding data analyst, a curious developer, or simply someone who wants to wield the power of data, understanding SQL is a game-changer. This blog post serves as your essential guide to conquering your first database, equipping you with the fundamental SQL queries you'll need to navigate its terrain. Along the way, we'll explore how these skills can be leveraged in the fascinating world of data science (with a nudge towards exploring an SQL Data Science course!). Unveiling the…
Read More
Greetings!

Greetings!

Greetings all. I'm really excited to be here. I'm a new developer, working hard to build up my skills. I focus mostly on Python and SQL, but am also learning full-stack web development (HTML, CSS, and JS). I'm really excited to join this community. I'm always looking to learn and never pass up the opportunity get better. I'm always willing to collaborate and learn more, as I'm still a newbie at this, even though I've been working hard for the last year, I feel like I move one step forward and take two steps back. I'm hoping that I can…
Read More
Understanding Chain-of-Thought Prompting: A Revolution in Artificial Intelligence

Understanding Chain-of-Thought Prompting: A Revolution in Artificial Intelligence

What is Chain-of-Thought Prompting? Chain-of-Thought Prompting is a method that guides language models through a series of logical steps to arrive at an answer or solution. Unlike traditional approaches where models generate responses directly, CoT encourages models to “think out loud,” detailing their reasoning process before formulating a conclusion. How It Works Problem Decomposition: The model is encouraged to break down a complex problem into simpler sub-problems. Reasoning Sequences: By stimulating thought sequences, the model can approach questions in a more structured manner. Iterative Reflection: The model can revise and refine its answers based on new information or identified errors.…
Read More
How to customize the User model in Django?

How to customize the User model in Django?

Image credits to: Pin In this post I explain three methods to extend or customize Django’s User model, without having to rewrite it from scratch, and keeping all Django’s user management features But, before we start, let’s see where Django’s User model comes from. Where does the Django User model come from? Django’s User model inherits from AbstractUser which, in turn, inherits from the AbstractBaseUser class. graph TD; AbstractBaseUser-->AbstractUser; AbstractUser-->User; If you look at the Django source code, you will see that the User model you normally use has virtually no functionality of its own , but inherits all of…
Read More
Como Escanear Portas em um Website com Python

Como Escanear Portas em um Website com Python

Você já deve ter ouvido falar do Nmap e de escaneamento de portas em servidores, bem, nesse script feito em Python vamos fazer algo bem semelhante, vamos verificar as portas abertas em websites. Vamos explorar um pouco de maneira simples e fácil de entender Introdução Portas abertas em um servidor são como portas de entrada para diferentes serviços. Saber quais portas estão abertas pode ajudar você a entender melhor a segurança do seu site ou simplesmente satisfazer sua curiosidade sobre o funcionamento interno de um site. Vamos mergulhar em um script que escaneia essas portas usando Python. Código completo import…
Read More
alternate way of doing word split/phrase segmentation in python

alternate way of doing word split/phrase segmentation in python

Doing word split with recursion felt a bit complex to me , so I tried to do it in an easier way. The Hard Way (recursion) -- def word_split(phrase,list_of_words, output = None): if output is None: #Base Case / Initial call output = [] for word in list_of_words: if phrase.startswith(word): output.append(word) return word_split(phrase[len(word):],list_of_words,output) # Recursive Call return output # Result Enter fullscreen mode Exit fullscreen mode gives The Easy Way (indexing/for loop) - def word_split_2(phrase, word_list): output = [] for i in word_list: if i in phrase: output.append(i) return output Enter fullscreen mode Exit fullscreen mode Source link lol
Read More
Use AWS Generative AI CDK constructs to speed up app development

Use AWS Generative AI CDK constructs to speed up app development

Assemble and deploy the infrastructure for a RAG solution using AWS CDK for Python In this blog, we will use the AWS Generative AI Constructs Library to deploy a complete RAG application composed of the following components: Knowledge Bases for Amazon Bedrock: This is the foundation for the RAG solution. OpenSearch Serverless collection: It supports the vector search collection type that provides similarity search capability. An S3 bucket: This will act as the data source for the Knowledge Base. AWS Lambda function (written in Python) along with an API Gateway that uses the RetrieveAndGenerate API to query the knowledge base…
Read More
How to Determine API Slow Downs, Part 2

How to Determine API Slow Downs, Part 2

A long time ago I wrote an article on how to determine that an API is slowing down using simple statistics known as linear regression. In the conclusion of that article, it was mentioned some challenges in applying linear regression. It is hard to define the reference point. Difficulty in defining the angle of the regression lines. The reference point means we need two regression lines to know whether the current situation is normal or abnormal, and the angle between the regression lines is the basis for our judgment. For those who are familiar with statistics or math, this approach…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.