teleren/devto huggingface dataset:
Mastering Essential Algorithms for Software Engineering Success
Published: 2023-08-27 16:36:30

Hey Dev community! 👋 As aspiring and passionate software engineers, we're constantly seeking ways to level up our skills. Today, let's take a quick dive into some key algorithms that hold immense importance, not only for nailing system design interviews but also for building real-world systems.

🔍 **Consistent Hashing**: Ever wondered how massive databases like Cassandra distribute data across servers? Consistent hashing is the answer. It's a smart approach where keys are mapped onto a ring, and servers are assigned ranges. This algorithm shines in the era of Big Data, ensuring efficient data distribution as servers join or leave.

🌲 **Quad Trees for Spatial Indexing**: When it comes to location-based services and mapping apps, quad trees come to the rescue. These trees divide 2D space into quadrants, enabling fast insertion and searches. If you're into spatial data indexing, quad trees are your go-to choice.

⏳ **Leaky Bucket Algorithm for Rate Limiting**: Imagine a leaky bucket that controls the rate at which requests are handled. It's a simple yet effective way to ensure fair usage of resources. This algorithm helps keep systems responsive and prevents overloads during spikes in traffic.

🌐 **Tries for String-Based Searches**: Tries are a powerful tool for string-related operations. They're perfect for autocompletion and lightning-fast searches. However, be mindful of memory usage due to multiple child pointers in nodes. 

🌼 **Bloom Filters**: Dealing with sets and membership checks? Bloom filters are your allies. They offer a probabilistic approach to quickly determine set membership, making them excellent for caching and filtering out noise in analytics.

🤝 **Consensus Algorithms (Raft and Paxos)**: Distributed systems are complex, and reaching consensus is a challenge. Enter Raft and Paxos. Raft, known for its simplicity, elects leaders to manage state replication and prevent data inconsistencies. It's used in various systems like Kafka for replication and failover.
How to Answer the Question: "Am I Good Enough?"
Tags: frontend, freelance, entrepreneur, webdev
Published: 2023-08-27 16:18:37

For the past several months, I've been grappling with a question that probably haunts many of us: "Am I good enough?" Am I good enough as a programmer? A designer? How about managing my time? The list goes on.

The Short Answer 

I honestly don't have a definite answer yet, but I'm working on it.

Being "good enough" at something you aspire to excel in is a double-edged sword. On one side, you are what you claim to be—in my case, a frontend developer. On the flip side, your work undergoes scrutiny. While some might applaud your design aesthetics and user experience, others may find it lacking or not aligned with their expectations.


## The Complex Reality

Becoming more proficient in your craft is a blend of dedication, time, and passion. But let's face it, the hustle and bustle of today's corporate world make achieving these three elements challenging. For most of us, the only viable route to honing our skills is to utilize whatever free time we can muster, often squeezed between family commitments, day jobs, and life's other obligations. So, how do you find the time to improve?


## A Hard Truth Worth Embracing

As a wise man once said:

> "Ease is a greater threat to progress than hardship. Without commitment, you'll never start, but more importantly, without consistency, you'll never finish."

This quote serves as a reminder that challenges are actually catalysts for progress. What I've learned over the past year is to "fake it till you make it." I repeated affirmations like "This is fun," "I like this," and "I enjoy it" until they became a reality. It might sound cliché, but this exercise helped instill a genuine sense of passion and a drive to learn, create, and evolve—not just as a programmer or designer, but as a person.


## The Journey is the Destination


In a developer's life, obstacles are a given. What we need to practice is not just the ability to clear these hurdles, but to relish the journey. Embrace the hardships, for they lead to real growth and progress. Master the art of enduring, and you'll find yourself not just meeting your goals but enjoying the process itself.
Funny Developing Mistakes I Wasted Hours on
Published: 2023-08-27 16:12:18

## Using Routing Module Instead Of Module
Because there were no erros in the console and whatever in the component file doesn't render.
```javascript
const routes: Routes = [
  {
    path: 'items',
    loadChildren: () => import('./comps/CompsRoutingModule.module').then(m => m.CompsRoutingModule)
  }
// That should have been just module.
];
```

## Same Variable Names Different Files
Sometimes we may introduce the same function or variable name in a different context. This can cause **VS Code to mess up the imports** we were looking for, especially if we didn't know that the name had already been used.

## `yarn dev` vs `yarn start`
`yarn start` doesn't refresh changes on file save. I sometimes accidently select `start`.

![node](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/97w3ol8sr7i57gxhq8k8.png)

## Using Wrong Environments in Postman
I just hit some `post` request to production without realizing for 10 mins.
![Postman](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/asxtpnalukjgqdvirpjt.png)

---
## Try Our new product for free!
[DocsAI](https://docsai.app/) - Create AI support agents with your documents in the most affordable price, starts at **0$**. Don't need a bot , but need ai help on your docs just upload and start chating !

Using for a company ? [Check out our pricing](https://docsai.app/pricing) Just contact me for personalized pricing !

![docsAi](https://firebasestorage.googleapis.com/v0/b/shrihari-personal-storage.appspot.com/o/banner-docs-jpeg.jpeg?alt=media&token=45c47666-de2a-4e02-8881-beb6e43ce581)

---
Free Open-Source Blog Template for Developers ✏️📃
Tags: javascript, opensource, astro, frontend
Published: 2023-08-27 15:55:12




**Openblog** is an elegant, simple, and user-friendly blog. Focused on accessibility, SEO, and performance.

Anyone can use this template to create their own blog or customize it for free.




<video width="320" height="240" controls>
  <source src="https://res.cloudinary.com/dqcgcp28m/video/upload/v1693081337/demo_ffusfi.mp4" type="video/mp4">
</video>


Give it a star 🌟 on Github if you find it useful.
>
GitHub [ Repo Link →](https://github.com/danielcgilibert/blog-template
) 
Check out the [ Live Demo →](https://blog-template-gray.vercel.app/)

## Features 

- ✅ Minimal styling
- ✅ Mobile responsive
- ✅ 100/100 Lighthouse performance
- ✅ SEO-friendly with canonical URLs and OpenGraph data
- ✅ Sitemap support
- ✅ RSS Feed support
- ✅ Markdown & MDX support
- ✅ Syntax highlighting
- ✅ Image optimization
- ✅ Table of contents
- ✅ Dark mode
- ✅ Reading Time
- ✅ [Pagefind](https://pagefind.app/) static search library integration
- ✅ Related posts
- ✅ Share posts (Linkedin, twitter)
- ✅ Draft mode
- ✅ Copy code block

## Lighthouse report
![Lighthouse report](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/am66wp7snlwejn9irgb7.png)
Starting with Android Development: Where the Heck Do I Begin? 😅
Tags: android, mobile, beginners
Published: 2023-08-27 15:35:05

Hey there,

So, I've decided to jump into the Android development whirlwind, but here's the thing: I'm a tad overwhelmed with where to start. 🤯 There's Java, there's Kotlin, and a ton of code-y stuff ahead.

Any suggestions on what's like the first building block I should tackle? I promise I won't judge if you say "start with a deep breath" 😄 But seriously, all tips are welcome!

Catch you on the code side! 🚀📱
Second career dev - the scary bit
Tags: career, beginners
Published: 2023-08-27 15:24:46

Learning to code and changing career was one of the best things I've ever done. I love being a developer and thoroughly enjoy my job. But, early on there were some lonely days, so I thought I'd write about my experience in case it helps anyone else going through it.

When I changed career, I left a company and job I'd been doing for a loooong time. I left behind team mates I loved, where we had years of memories and in-jokes. I knew my job inside out, was a subject matter expert, and a line-manager.

Starting in a new company as a junior developer was wonderful. It was a dream come true and I'd worked really hard to get there. It was also really freeing. I had no baggage or office politics to worry about, no line reports or responsibilities, and I had the space and support I needed to focus on learning and progressing as a developer.

But at the same time it was scary, and lonely. I knew nothing! Ok...maybe not nothing, but that's how it felt. I felt exposed and vulnerable. Getting our of your comfort zone is scary but rewarding. Going from "go-to person" to "junior newbie" is a leap of faith.

So what can you do to get through it?

- **Accept** it is going to be a bit scary! It means you're out of your comfort zone and that's where you'll grow and learn. 
- Don't do it in your own. **Reach out** to your line manager, your team, and your network. Be open and honest about how you feel. If you're too scared and worried you won't learn effectively.
- Don't have a **network**? Find one or make one! Find friendly coding meet-ups, use social media/online forums, reach out to other new developers in your organisation. It really helps to talk to others at the same stage of their careers/coding journey.
- Try not to worry about making **mistakes**. Everyone makes them, especially early on, and they'll make you a better developer in the long run. A good team will catch you and help you fix it.
- Don't forget about your **transferable skills**. You may feel like a code newbie but you will bring a load of transferrable skills to your 2nd career. It's your super power! Software Development is much more than just writing code and you'll use those skills more and more as your new career develops.
- **Document** what you learn - whether it's writing a blog or just keeping a note of what you've learned each day/week. It'll help consolidate your learning and you'll be amazed after a few months to look back and see how far you've come.
- Keep a note of any nice **feedback** you get. When you're having a bad day (and there will be some!) you can read through the good stuff and give yourself a boost. 


It's been 7 years since I switched careers and I'm now a Senior Developer. I still feel scared somedays but then I guess that's how I know I'm still learning and growing! :D
🌟Boost Efficiency with AWS EC2 Hibernation!
Published: 2023-08-27 15:01:48

**Introduction:**
In the fast-paced realm of cloud computing, cost optimization is key. Enter AWS EC2 hibernation - a game-changer for resource management. 🚀

**What's EC2 Hibernation? 🛌**
AWS EC2 hibernation lets you pause instances instead of axing them, saving their state and memory. Think of it as a power nap for your virtual machines! 💤

**Benefits Galore! 🌈**
💰 Cost Savings: Hibernating instances trims costs, paying only for storage. Say goodbye to 24/7 expenses!
🧠 State Preservation: Hibernation keeps your apps' memory intact. No more reboot hassle or data loss.
⏱️ Speedy Startups: Skip the boot process! Hibernated instances quickly get back to work.
🌍 Green Impact: Hibernation reduces energy spikes during restarts, being kinder to the environment.

**Smart Uses! 🌐**
🔬 Dev-Test Playgrounds: Save money by hibernating non-essential instances after hours.
🔄 Batch Magic: Pause instances between batch jobs - cuts costs and speeds up processing.
📊 Data in Memory: Ideal for databases and caching. Keep data intact, even during pauses.
🌐 Web Wonders: Optimize costs by hibernating during low-traffic hours without impacting users.

**How to Hibernate? 🛌🔌**

- Activate Hibernation: Check if your instance type supports it. Enable via console, CLI, or SDKs.

- IAM Magic: Update instance profiles' IAM policies for hibernate and resume permissions.

- Auto-Pilot Mode: Use CloudWatch alarms and Lambda to automate hibernation based on triggers.

**In a Nutshell: 🌰**
In the world of precious cloud resources, AWS EC2 hibernation shines as the thrifty hero. It's your ticket to balancing availability, savings, and eco-consciousness. Time to hibernate and save! 💡💸🌿

#DevOpsHeroes #CloudEfficiency #aws #k8s #monitoring #devops #remotejobs
GitUI 0.24 supports searching the entire commit history
Tags: git, rust, terminal, productivity
Published: 2023-08-27 14:46:14

[GitUI](https://github.com/extrawurst/gitui) is a terminal UI for git written in Rust. We aim to simplify common git tasks in a fast, keyboard-only and cross platform way without leaving your beloved CLI.

## Release Highlights

* searching commits via sha, commit-msg, author or files-changed
* better visuals of changes to line breaks in diff 
* simplify theme overrides
* support for sign-off of commits
* [much more](https://github.com/extrawurst/gitui/releases/tag/v0.24.0)

Thanks for your interest and support!❤️
My new side project
Tags: javascript, programming, opensource, coding
Published: 2023-08-27 14:30:03

Once you gain the basic knowledge to understand a programming language it's still a while before you feel competent with that language. The best way to learn and gain competence is by making something. Then re-making that thing several times because you just didn't like the way it felt the first few times.


I am working on my proficiency with javascript so I decided to make a game. I picked out a clear goal of what I wanted to make and am fumbling through the logistics. I am learning a lot. Let me go over the idea itself in more detail.


## the Idea

To make the logic easier to implement I decided to make a turn based game that two people would play together on one device.  I loved RTS type of games like starcraft, age of empires and stronghold growing up so I was inspired by that. Each player would be building a castle producing gold and using that to buy units that will make more gold or attack the other player. To keep things simple I will only have 2 unit types, one for attacking and one for making gold. Each player has a set of 20 hit points and the goal is to make your opponents hit zero before yours does. 


## the Goal

To make this game using a functional appoach so that it may be expanded with ease. Publish all the code on git hub and write detailed blog posts about making the game and how it works which will then act as the docs for the project. Doesnt sound to hard right? Now that I have clear goal its time to get to work.


## the gameplay

Each players turn will consist of three phases. The first will be when they select which unit they want to produce. Gold is deducted from the player at this point but the new unit will not appear in their list until the following turn. The second is when they decide on actions for their worker units. Workers have 2 actions make gold and sacrifice for hp. When making gold the unit produces 1 gold added to the players wallet the following turn. When sacrificed the unit is removed from playets list and the player gains 1 hp. The hit point is awarded after all other action have taken place for that turn. Note that if a players hp reaches zero before the awarded points from a sacrifice are added the player whos  hp hit zero still looses the game. The thrid and final phase is actons for fighters who can defend or attack. The attack will inflict 1 damage against the opponents hp. However if set to defend a fighter will cancel out the damage from an opponents fighter set to attack.  Both units will then be removed from the players lists. If you set a fighter to defend and are not attacked nothing happens.


So now the goal is layed out. Still not sure what the UI will look like yet but thats for another post. Just working on the basic logic for now using console.logs to test function outputs. I hope you find this helpful or interesting. 

UPDATE
Here is a link to the [github repo]
(https://github.com/techThatConnect/Swords_and_Hammers)
The following articles will explain how the code works and why I made the choices I did.
iOS ScrollView - make it snappy!
Tags: swift, mobile, swiftui, ios
Published: 2023-08-27 14:14:52

In iOS17, Swift UI has some new modifiers which make it easier to implement snap behaviour in scrollviews.

## ScrollView

Let's make a simple scrollview:

```swift
import SwiftUI

struct ContentView: View {
    var body: some View {
        ScrollView(.horizontal) {
            LazyHStack {
                ForEach(0..<20) { i in
                    TileView(title: String(i))
                }
            }
            .padding()
        }
    }}

struct TileView: View {
    let title: String
    var body: some View {
        Text(title)
            .foregroundStyle(.white)
            .frame(width: 150, height: 100)
            .background(.purple)
            .clipShape(.rect(cornerRadius: 20))
    }
}

#Preview {
    ContentView()
}
```

**Reminder:** Using `LazyHStack` instead of `HStack` means the tiles are only loaded when needed and not upfront. 

This gives us a simple horizontal scrollview:

![Basic ScrollView](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gv24vqcky9ncwa1zedni.gif)

The default behaviour is free scrolling, and the view stays wherever it finishes after scrolling:

![Default small scroll](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a6p17ug0kc7kee4u2s40.gif)


## Paging Behaviour

We can add the modifier `.scrollTargetBehavior(.paging)` to our scrollview:

```swift
struct ContentView: View {
    var body: some View {
        ScrollView(.horizontal) {
            LazyHStack {
                ForEach(0..<20) { i in
                    TileView(title: String(i))
                }
            }
            .padding()
        }
        .scrollTargetBehavior(.paging)
    }
}
```

This means the scrollview will scroll one screen width at a time and snaps nicely to each page:

![ScrollView with Paging modifier](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a49zozzmhvd23jj1ajsq.gif)

## View Aligned Behaviour

Instead of using paging, we can use the modifier `.scrollTargetBehavior(.viewAligned)` along with `.scrollTargetLayout()` on the view we want to be used for settling.

```swift
struct ContentView: View {
    var body: some View {
        ScrollView(.horizontal) {
            LazyHStack {
                ForEach(0..<20) { i in
                    TileView(title: String(i))
                }
            }
            .padding()
            .scrollTargetLayout()
        }
        .scrollTargetBehavior(.viewAligned)
    }
}
```

This gives us the the following behaviour where the scrollview snaps to the individual views:

![Scroll View with View Aligned Modifier](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9isdwln71an8tapdc4jp.gif)

## Additional Notes

- This can all be applied to vertical scrollviews as well. I've just used horizontal ones here as examples.

- These modifiers are only available in iOS 17 / Xcode 15

- More information and options to experiment with in Apple's docs https://developer.apple.com/documentation/swiftui/scrolltargetbehavior
I'm a Marketing and Systems Analyst professional and an entrepreneur at heart.
Tags: webdev, tutorial, react
Published: 2023-08-27 14:04:24

Ten years experience coordinating social media marketing strategies that position businesses toward optimal growth. Some of my available services include:
➡️ [Social Media Marketing]
➡️ [Social Media Promotion]
➡️ [Social Media Advertising]
➡️ [Social Media Manager]
➡️ [Social Media Overview]
https://www.upwork.com/freelancers/~01e51c3b7168c30dd7
I'm a professional digital marketer with many years of experience,
Tags: digitalworkplace, webdev, beginners, productivity
Published: 2023-08-27 14:00:45

Some of my available services include: ➡️ Social Media Marketing ➡️ Social Media Promotion ➡️ Social Media Advertising ➡️ Social Media Manager ➡️ Social Media Overview
(https://www.fiverr.com/shahinaafroz)
iOS Simulator Screen Recording
Tags: ios, xcode, swift
Published: 2023-08-27 13:29:40

Recording a video of the simulator used to be a bit clunky - either using the command line via `simctl` or other software such as Quicktime. Thankfully it's now much easier!

## Screen Recording in Xcode

Above the simulator is a toolbar which includes a button to take a screenshot:

![Xcode Simulator Toolbar with screenshot button](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p98x4env7h36byqwpl4e.png)

In the `File` menu there is an option to `Record Screen`.

![Record screen option](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o23hs8alrmcml5nevtma.png)

Selecting this option, or pressing `Command + R`, starts recording the simulator. The screenshot button changes to a stop recording button.

![Xcode Simulator Toolbar with screenshot button](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ezgd88f2uhfmhedq2rnq.png)

When you've finished the task you want to record, simply tap the stop button. A preview will show on screen briefly and then the recording will be saved to your Desktop as an `mp4`.

![Screen Recording Preview](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s1351dyrb8fddli0w4ul.png)

## Additional Options

While the preview is on screen you can also right click and choose other options including `Save as Animated GIF`.

![Screen Recording Preview Menu](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lbir6rkwp5un6lnuj3o2.png)

(**TIP**: to play the GIF, locate in Finder and then press the spacebar).
Guess My number
Tags: javascript, webdev, programming, beginners
Published: 2023-08-27 13:28:39

Hey Dev.to community! 👋 I'm excited to share a fun and interactive project I've been working on: the Guess My Number Game. In this post, I'll give you a sneak peek into the game and show you how to play it. Let's dive right in!

About the Project
The Guess My Number Game is a simple yet engaging game built using JavaScript and DOM manipulation. It's a great way to practice your programming skills while having fun at the same time! The game randomly selects a secret number between 1 and 20, and your goal is to guess that number within a limited number of attempts.

How to Play
Playing the game is a breeze:

The computer selects a secret number between 1 and 20.
You input your guess in the provided field.
After each guess, you'll receive a hint about whether your guess is too high or too low.
Keep guessing until you get it right or run out of attempts.
Features
🔢 Number Guessing: Put your intuition to the test by guessing the secret number.

💡 Hints: Receive helpful hints after each guess to guide you towards the correct answer.

🎉 Winning: Celebrate when you guess the correct number and see if you can beat your highscore!

How to Play
Clone the repository to your local machine:

git clone https://github.com/MohammedAfthab18/guess-my-number.git