learning

Ruby exception Handling Pitfall: Understanding Rescue Clause Hierarchy

Ruby exception Handling Pitfall: Understanding Rescue Clause Hierarchy

Context Let's consider the following code, defining basic classes and one custom error: class CustomError < StandardError; end class Parent def raise_custom_error raise CustomError rescue StandardError puts "StandardError rescued" end end class Child < Parent def call raise_custom_error rescue CustomError puts "CustomError rescued" end end Enter fullscreen mode Exit fullscreen mode Now, let's examine the following method call:: Child.new.call Enter fullscreen mode Exit fullscreen mode To summarize, this code does the following: Defines a CustomError class that inherits from StandardError Creates a Child class with a #call method that invokes raise_custom_error from its parent class Parent Implements exception handling in…
Read More
What is an interface in Golang, and why is it important in building large-scale systems?

What is an interface in Golang, and why is it important in building large-scale systems?

An interface in Golang is a set of method signatures (behaviors) without specifying how they are implemented. Any type that implements those methods is said to satisfy the interface, without explicitly declaring so. This feature allows for flexible, decoupled, and modular design. type Animal interface { Speak() string } type Dog struct {} func (d Dog) Speak() string { return "Woof" } type Cat struct {} func (c Cat) Speak() string { return "Meow" } func MakeAnimalSpeak(a Animal) { fmt.Println(a.Speak()) } func main() { dog := Dog{} cat := Cat{} MakeAnimalSpeak(dog) MakeAnimalSpeak(cat) } Enter fullscreen mode Exit fullscreen mode In…
Read More
Fundamentos de Operadores

Fundamentos de Operadores

Os fundamentos de operadores em programação são essenciais para realizar operações matemáticas, comparações lógicas, manipulação de dados e controle de fluxo dentro de um programa. Vamos aprender eles usando JavaScript? Principais tipos de operadores em JavaScript: 1. Operadores Aritméticos São usados para realizar operações matemáticas entre números. Esses operadores incluem: Adição (+): Soma dois valores. Subtração (-): Subtrai o segundo valor do primeiro. Multiplicação (*): Multiplica dois valores. Divisão (/): Divide o primeiro valor pelo segundo. Módulo (%): Retorna o resto da divisão entre dois valores. Exponenciação (``)**: Eleva o primeiro valor à potência do segundo. Exemplo: let a =…
Read More
Will AI Make Decisions for Me? Understanding the Impact of AI on Our Choices

Will AI Make Decisions for Me? Understanding the Impact of AI on Our Choices

As AI becomes more integrated into our daily lives, many people are starting to wonder just how much influence these systems will have over our decisions. From recommendation algorithms suggesting what to watch or read next, to AI tools helping businesses with hiring and customer service, the potential of AI to shape our choices is undeniable. But with great power comes great responsibility—especially when we consider that AI models are often built on biased data. So, the question remains: can AI help us make better decisions, or should we be cautious about how much control it has over our lives?…
Read More
Understanding SOLID Principles in C#

Understanding SOLID Principles in C#

As developers, we often come across the term "SOLID" principles, which are a set of five design principles that help us write maintainable, scalable, and efficient code. However, understanding and applying these concepts in real-life projects can sometimes be tricky. To make it simpler, let's break down each principle with practical, relatable examples and code snippets that any developer can understand. 1. Single Responsibility Principle (SRP) Real-Life Example: Imagine you’re organizing a community event, and Alex, your friend, tries to handle everything—from setting up the venue, to promoting the event, to managing food. With so many responsibilities, things often slip…
Read More
Think Like a Problem Solver, Not the Best Programmer

Think Like a Problem Solver, Not the Best Programmer

In the world of programming, there's often an unspoken race to be "the best." Programmers strive to master every language, framework, and tool, aiming to be seen as the most knowledgeable or technically skilled. But as appealing as it sounds, chasing after the title of "best programmer" might not be the most valuable goal. Instead, what truly matters—what leads to long-term success and impact—is thinking like a problem solver. Programming is, at its core, about solving problems efficiently and effectively. It’s not about who can write the most complex code or master the most libraries; it's about using the tools…
Read More
Fibonacci, Integer overflow, memoization e um exagero

Fibonacci, Integer overflow, memoization e um exagero

Vamos fazer um exercício. Abaixo deixo um código que retorna o número na posição n da sequência de Fibonacci: public static int fib(int n){ if (n <= 1){ return n; } return fib(n-1) + fib(n-2); } Enter fullscreen mode Exit fullscreen mode Que tal tentarmos mostrar no nosso terminal todos os números da sequência de fibonacci menores que 2147483647? public static int fib(int n){ if (n <= 1){ return n; } return fib(n-1) + fib(n-2); } public static void main(String[] args) { int position = 1; int currentNumber = fib(position); while (currentNumber < 2147483647) { System.out.println(currentNumber); position++; currentNumber = fib(position);…
Read More
Learn how to build AI assisted blog from scratch

Learn how to build AI assisted blog from scratch

In guide you will learn: how to create seo friendly opensource Nuxt instance how to set-up admin panel using opensource node admin framework AdminForth how to add openai plugins to adminforth how to bundle 2 intances (nuxt + node admin) in single docker container how to automatically spawn one EC2 instance and put docker container there how to add ssl for free using cloudflare Guide: https://adminforth.dev/blog/ai-blog/ Source link lol
Read More
Learning GO: 05

Learning GO: 05

Hey! I am Currently learning Go Lang, and I am taking some basic Notes on my Notion and though I'd also just publish them here. They are not well thought out or well written but it's just me taking notes from time to time for my reference. I am taking the Udemy Course by Maximilian Schwarzmüller, Notes Defining Functions all the user defined Functions are defined below the main function a function in Go can be defined using func keyword We can add parameters to the function, when adding parameters we have to define the type of the parameter func…
Read More
Behavioural Interview Guidance

Behavioural Interview Guidance

1. Question: Tell me about a time when you had to handle a challenging project with tight deadlines. How did you manage to deliver it successfully? Possible Answer: "In my previous role as a project manager, I was given a tight deadline to implement a new CRM system across the organization. The challenge was the integration with our existing systems, which required a lot of customization. To meet the deadline, I prioritized tasks using a Kanban board, broke down the project into manageable sprints, and held daily stand-up meetings to ensure alignment. I also encouraged the team to escalate issues…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.