teleren/devto huggingface dataset:
Crafting Games: Building a Custom Editor with Undo/Redo Support
Tags: gamedev, programming, productivity, learning
Published: 2023-09-12 12:17:32

Recently I’ve added Spline Based Editing to my level editor for building racetracks. This speeds up the process significantly because the designer, *me*, can drag a few nodes around the world and generate a smooth racetrack. The editor automatically creates the racetrack surface from a simple segment mesh that is input.

I did take a few shortcuts by using the CatmullRom to create the control points/handles for the underlying BezierCurve. This ensures the curve will pass directly through all the points, but doesn’t allow the designer complete control over the curve. It shouldn’t be the end of the world to add these later, *famous last words.*

Any *good* tool will support Undo/Redo and Track Builder (my editor) is built to be a *good* tool! Track Builder has been in development, *adding a feature here and there*, since 2019. Undo/Redo support was built in from the start using a command-based system. Each action the user can take is a small object that modifies the state of the editor/data, like: class `AddNewOjectCommand`.

This keeps a very small memory footprint and allows for the possibility of real-time collaboration features. 🤣 That will **never** happen! But commands do become a pain to deal with for add and delete type actions since object lifetimes are difficult. State-based undo/redo support is a little easier, tracking each state change by copying the previous state before making changes. This uses more memory, but that’s cheap these days!

## Protip:

>You can actually combine the command-based with state-based undo/redo support and if your (*partial)* state is small, it might not even use much memory.

For splines the state is actually quite small, just a handful of positions, so I created a generic `ChangeSplineCommand()` which took in the state of the spline before and after the change. This let me mix the command-based system with a bit of state-based undo/redo and get the support with minimal effort!

**Why Not Use <MAJOR> Game Engine?**

This is a great question and as an independent developer it is one that should be very carefully considered. I have weighed the benefits carefully and although speed and ease of development may be improved with a major engine, it doesn't fit my long-term goals.

With a custom built engine:

* I have full ownership of the engine.
* I can design a workflow to meet my expectations.
* I am responsible for, and capable of, fixing bugs.
   * Don’t need to design/work around issues.
   * OpenSource doesn’t always pull your fix/patches.
* Having complete control over EXACTLY HOW things work.
   * No guessing, no undesired shortcuts, etc

This week I’m adding functionality to create decals, the plan is to add them into the editor first as cuboids and stub out the architecture in the game engine. I plan to hire this out because …

You can [watch the development process](https://www.twitch.tv/timbeaudet) of building custom editors this week and get inspired for your own tools to create games faster!
A Strategic Planning Towards Your Ruby on Rails Upgrade Timeline
Tags: webdev, ruby, rails
Published: 2023-09-12 12:02:33

We all are have understood the importance of Ruby on Rails upgrad. Still many of us get confused that Ruby on Rails upgrade is needed but when. The decision to upgrade should be a strategic one, taking into account various factors that can influence the timing of the upgrade. 

In this blog we will talk about the  importance of choosing the right timing for your Ruby on Rails upgrade and explore the key considerations you should keep in mind.

##Why Timing Matters for Ruby on Rails Upgrade?

Before we get into the specifics of timing, we should understand why it matters in the context of a [Ruby on Rails upgrade](https://www.bacancytechnology.com/rails-upgrade-service). Rails is a dynamic framework that undergoes continuous development, with new versions released regularly. These updates include bug fixes, security patches, performance enhancements, and new features. 

let's explore the factors that influencing decision on when to upgrade:

####1. Project Deadlines

Keep in mind the current stage of your project and any impending deadlines. If you're in the middle of a critical phase or have a major release scheduled soon, it can not be the best time to disrupt the development flow with an upgrade. In such cases, it might be better to plan the upgrade for after the release.

####2. Security Concerns

Security should be a top priority. If a security vulnerability is discovered in your current Rails version, you may need to expedite the upgrade process. Keep an eye on Rails security announcements and act promptly if your version is affected.

####3. Feature Requirements

Also check that the new features and improvements in the latest Rails version align with your project's goals or not. If a new feature is essential or can significantly benefit your application, it might be a good reason to prioritize the upgrade.

####4. Gem and Library Compatibility

Do not forget to Check that if the gems and libraries your application relies on are compatible with the version of Rails you're considering. If they aren't, you may need to wait until they are updated or find alternatives.

####5. Team Availability
Consider the availability of your development team. If key team members are unavailable due to vacations or other commitments, it may be wise to schedule the upgrade when your team is at full strength.

####6. Testing and Quality Assurance

Plan and schedule a sufficient time for thorough testing and quality assurance. Rushing through the upgrade process can lead to errors and issues. Ensure that your testing plan is comprehensive and includes both automated and manual testing.


##Conclusion

Choosing the right timing for your Ruby on Rails upgrade is a critical decision that can impact the security, performance, and stability of your application. It is advisable to carefully consider the project deadlines, security concerns, feature requirements, compatibility, team availability, testing, backup plans, and staging environments, you can make an informed decision that minimizes risks and maximizes the benefits of upgrading.
Behind the Curtain: Unraveling the Technical Wizardry of Mystery Box Platforms
Tags: mystery, hypedrop, mysterybox
Published: 2023-09-12 12:02:18

The operation of mystery boxes from a programmatic perspective involves several key components and processes. Here are the main ideas on how mystery boxes work on the program side:

Randomization Algorithms: Mystery box platforms use randomization algorithms to determine the contents of each box. These algorithms generate random outcomes for users, ensuring that the items inside the boxes are unpredictable and not predetermined.

**Item Inventory:** Behind the scenes, there is an inventory of items categorized by rarity and value. Each item is assigned a specific probability or "drop rate" of being included in a mystery box. More valuable or rare items typically have lower drop rates.

**User Interaction: **Users select and purchase a mystery box of their choice from the available options. The program then initiates the randomization process to determine the items that will be placed in the box.

**Real-Time Processing:** The program processes each user's request in real time, ensuring that the outcome of each box is unique and independent of previous results. This real-time processing adds an element of suspense and fairness to the experience.
**
Verification and Fairness:** Mystery box platforms (like [Hypedrop](https://silverhanna.com/hypedrop-promo-codes/), HypeUP, Hybe, etc.) often have mechanisms in place to ensure fairness. This includes verifying the randomness of outcomes through third-party audits or cryptographic methods to prevent manipulation.

**Item Display:** After a user opens a mystery box, the program displays the items received in an engaging and visually appealing manner. This can include animations, sound effects, and item descriptions.

**Monetization:** The program also handles monetary transactions, deducting the cost of the mystery box from the user's account balance or cryptocurrency wallet.

**User Inventory:** Users have access to an inventory where they can view and manage the items they've received from mystery boxes. This inventory may also include options for trading or selling items.

**Community and Social Features:** Many platforms include social features like chat, forums, and user profiles to foster a sense of community and interaction among users.

**Security and Privacy:** Robust security measures are essential to protect user data and ensure the integrity of the platform. This includes encryption for financial transactions and user account protection.

**Licensing and Compliance:** Depending on the region and nature of the items included in mystery boxes, [platforms](https://aeroshield.me/hypedrop-promo-codes/) may need to adhere to licensing and regulatory requirements, ensuring that they operate within the bounds of the law.

Overall, the programmatic side of mystery boxes is a complex and carefully orchestrated system that aims to provide an engaging and enjoyable user experience while maintaining fairness and transparency.
React Application- Suppress the Virtual Keyboard when Barcode Scanner Text box Active/ Focused (Tablet)
Published: 2023-09-12 11:57:54

Good Evening

when we scan bar codes from our application, sometimes when we hit the confirm button, the virtual key board pops up (Tablet - Android Device), which it should not because at that time all scannable fields are completed and we are only trying to save .

We would like to suppress the pop up of virtual keyboard.

We have active /Focused Text box - When Scanning is completed , We click Save Save - Will call some api (Backend Process) and when save is successful it will return next set off Task to the Front End. In this action , getting the virtual Keyboard - Which we should suppress Could you please help

When the page is loaded, Focus is set to Barcode Scanner text control , We dont get any virtual Keyboard on page loading but we do get when the record is saved and other setup task is pushed from Backend to FrontEnd

I tried like , barcodeRef.current.focus() or barcodeRef.current.blur()

after Blur event when i tried to focus the text box i am getting the virtual Keyboard .

How do i resolve the issue - Could you please help
Movies App using HTML CSS and JavaScript
Tags: javascript, html, css, tutorial
Published: 2023-09-12 11:56:07

Movies App using HTML CSS and JavaScript

hey guys hope you all of fine, today we are going to learn how to create a movies app using html css and javascript. Inside the project we are going to API to fetch the data from movies website, once we fetched the data from movies website using API.

Then we are including the particular content inside our website or application. So, inside the application have many features such as Search Movies, TV Shows and also have a pagination. Those features inside the application.

After watching the complete video tutorial I hope you will get many ideas from it, also hope this tutorial is helpful and beneficial for you.

{% embed https://www.youtube.com/watch?v=_DaH6PIn0Ak %}

If you are interested to become a front end developer, I will teach you everything step by step. I've been sharing the complete HTML, CSS and JavaScript based tutorial on my channel. Also I will be sharing those technology videos on my channel,  want to improve you skills, keep touch my channel.
Empowering Voters: MyVoteMyIndia – Your One-Stop Destination for Informed Voting
Published: 2023-09-12 11:46:26

In a thriving democracy like India, the power to choose our representatives is a fundamental right and a significant responsibility. Every Lok Sabha election is an opportunity for citizens to shape the nation's future by electing leaders who align with their vision and values. Informed voting is at the core of this democratic process, and to facilitate it, a powerful platform has emerged: [MyVoteMyIndia](https://www.myvotemyindia.in/).

## The Power of Informed Voting:

Informed voting is not just a privilege; it's a necessity. It ensures that the people's voices are accurately represented in Parliament. But making an informed choice requires access to comprehensive and reliable information about election candidates, their background, history, and track record. This is where MyVoteMyIndia comes into play.

## MyVoteMyIndia: Your Ultimate Election Resource:

MyVoteMyIndia is a website designed with one simple yet powerful goal: to empower voters by providing them with essential information about Lok Sabha election candidates. This platform offers a treasure trove of data, including candidate histories, financial backgrounds, and any criminal records they may have. Here's how it benefits voters:

1. **Transparency:** MyVoteMyIndia is committed to transparency in the electoral process. It strives to ensure that voters have access to candid and unfiltered information about the candidates vying for their votes.

2. **Accountability:** By making candidates' financial records available, the platform encourages accountability in politics. Voters can see the sources of a candidate's income and assess potential conflicts of interest.

3. **Informed Decision-Making:** Informed voters are more likely to make decisions that align with their values and aspirations for the nation. MyVoteMyIndia equips voters with the knowledge they need to cast their votes wisely.

4. **Strengthening Democracy:** A well-informed electorate is the backbone of a strong democracy. MyVoteMyIndia contributes to the strengthening of India's democratic foundation by promoting transparency and accountability in the electoral process.

**Visit MyVoteMyIndia Today:**

In a world driven by data and information, being an informed voter is not just a right; it's a responsibility. MyVoteMyIndia understands the significance of this responsibility and strives to make the process as easy as possible.

So, as we approach the next Lok Sabha election, I encourage you to visit [MyVoteMyIndia](https://www.myvotemyindia.in) and explore the wealth of information it offers. Together, we can ensure that our votes are not just a mark on a ballot but a powerful expression of our vision for India's future.

Let's make every vote count, and let's make informed decisions for a stronger, brighter, and more prosperous India. #MyVoteMyIndia #InformedVoting #LokSabhaElection
Marine Navigation Communication UAE
Published: 2023-09-12 11:46:08

Our expertise spans across marine electrical, automation, and instrumentation, making us the go-to choice for [Marine Navigation Communication services in UAE](https://mastersystems.com/communication-navigation/). Trust us to keep your vessels connected and navigated with precision and reliability.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d4zne3kykqwmzrqa2j7c.jpg)
Blazor Vendor Lock
Tags: blazor, csharp, dotnet, aspdotnet
Published: 2023-09-12 11:40:50

Have you ever faced this famous question? 
> If we migrate to Blazor, wouldn't it be a **"Vendor Lock"**?

This is a common concern of people when I consult with their company to migrate their technology stack to Blazor.

> The term *“vendor lock”* describes the situation in which customers depend on a single manufacturer or supplier for some product (i.e., a good or service), and cannot shift to another vendor without incurring substantial costs or inconvenience [[mitre.org](https://www.mitre.org/sites/default/files/publications/gaining-leverage-over-vendor-lock-14-1262.pdf#:~:text=The%20term%20%E2%80%9Cvendor%20lock%E2%80%9D%20describes%20the%20situation%20in,another%20vendor%20without%20incurring%20substantial%20costs%20or%20inconvenience.)]. 

In my opinion, this is a great question as it shows that the manager has a long-term mindset. It doesn't question Blazor's capabilities (which are awesome), but it questions if this decision locks us to a specific vendor: .NET.

## Vendor Diversity
While "Vendor Lock" is an important concern that should be considered, there are other concerns like **"Vendor Diversity"**. If you have different technology stacks, you need to have different teams with different skills. This doubles your HR concerns to find the right people for each stack.

> It seems **Vendor Diversity** is a much bigger concern than **Vendor Lock**.

![Vendor Diversity](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hbed0k9jjevm1e2pa576.png)

The key question here, is if we want Vendor Diversity or not?

## Small Team Big Impact
So, sticking to a platform is not necessarily a wrong decision if the platform is worth it. In a previous [blog post](https://mehrandvd.me/2022/12/11/small-team-big-impact-blazor-magic/) of mine, I describe how a cross-platform stack can help your team achieve more with fewer members. You can check it out here: [Small Team Big Impact: Blazor Magic](https://mehrandvd.me/2022/12/11/small-team-big-impact-blazor-magic/)

If you are going to choose one stack to stick to, .NET is an amazing decision. With .NET, you can write code almost everywhere: 
 - Backend (ASP.NET Core)
 - Frontend (Blazor)
 - Mobile: Android, iOS (Blazor+Maui)
 - IoT (RaspberryPI)
 - Gaming (Unity)
 - Desktop: Windows, macOS Linux (Blazor+Maui)

With this ecosystem, I think it's much more of a _**Vendor Luck**_ than a Vendor Lock.
![Good Luck with Blazor](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kfu7vhi25qg190uflshb.png)
How to insert a responsive YouTube Video to react using Tailwind CSS
Tags: webdev, react, tailwindcss
Published: 2023-09-12 11:40:49

In this tutorial, we'll walk you through the process of embedding a responsive YouTube video into a React application while using the popular CSS framework, Tailwind CSS. By the end of this guide, you'll have a sleek and responsive YouTube video player integrated into your React project.

## In Short:
Here is a component that contains a responsive YouTube video by using the style from tailwind `aspect-video`.

```
<div className=' aspect-video ' >
    <iframe 
        className=' h-full w-full rounded-lg'
        src="https://www.youtube.com/embed/4WiH9pf2ULQ?si=2TzjHgKzRDOgi528" 
        width="100%" 
        title="YouTube video player" 
        frameborder="0" 
        allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen> 
     </iframe>
</div> 
```

***Preview***
![alt](https://firebasestorage.googleapis.com/v0/b/ahmed-mannai.appspot.com/o/uploads%2F1694517543274.png?alt=media&token=225d791a-209f-4f5d-b3e5-4fef8e753388)

## Setup React & Tailwind CSS
The following for setting up react project with tailwind CSS
### Step1: Create a React Project
if you don't have a React project set up, you can create one using `create-react app`:
```
npx create-react-app youtube-video-embed
cd youtube-video-embed
npm start
```
#### Step2: Install Tailwind CSS
To use Tailwind CSS in your React project, install it by running the following command:
```
npm install tailwindcss
```
Once it's installed, you'll need to create a configuration file:
```
npx tailwindcss init
```
#### Step 3: Configure Tailwind CSS
Open the `tailwind.config.js` file generated in your project root and update it to include the following: 
```
module.exports = {
  purge: [],
  darkMode: false,
  theme: {
    extend: {},
  },
  variants: {},
  plugins: [],
}
```
#### Step 4: Embed the YouTube Video:
In your React Project, create a new component that will display the YouTube video
For example `YouTubeEmbed.js`

```
import React from 'react';

const YouTubeEmbed = ({ embedId }) => {
  return (
    <div className="aspect-w-16 aspect-h-9">
      <iframe
        className="w-full h-full"
        src={`https://www.youtube.com/embed/${embedId}`}
        title="YouTube video player"
        frameborder="0"
        allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
        allowfullscreen
      ></iframe>
    </div>
  );
};

export default YouTubeEmbed;
```

Congratulations! You've successfully embedded a responsive YouTube video into your React application using Tailwind CSS. You can further customize the appearance and styling of the video player by modifying the Tailwind CSS classes in the YouTubeEmbed component to match your project's design.
17 years of frustration: The best lesson I've learned about teaching
Tags: learning, career, motivation, teaching
Published: 2023-09-12 11:38:04

Once, a young boy received a book as a gift from his grandparents. The boy's grandpa loved to play the accordion, so it was no surprise that the book was called 'Jaunasis pianistas' (The Young Pianist). However, it was still magical to the boy. He had been dreaming of learning how to play since he first saw the instrument. The excitement couldn't be held any longer. He turned the first page.

'The mind is not a vessel to be filled, but a fire to be kindled,' he read on the first page. It was the foreword to a teacher.

---

But this is not a story about learning piano or music. It's a story about teachers and teaching.

In my 6th grade, I had to choose a secondary language at school. Between German and Russian, the first one looked more interesting to me. So I chose it. What I didn't know is that for the next 5 years, I would have to endure a teacher who smiled at the beginning of the lesson and screamed at the end. She got angry when somebody made a mistake and called people idiots when they couldn't remember new words.

Five years is a long time. She did manage to fill my head with German words and grammar rules. But along with that, she filled me with pure anger towards the language and everything related to it.

At the end of the 10th grade, she came to us with her typical fake smile, saying how much fun it would be if we chose German for higher grades. Finally, I could tell her what I thought in her own language.

---

The last 12 years were enough not only to bury the words I used to know but also the hatred. Yesterday, I took the book again and started 'den Staub entfernen' (to dust off). It took me 12 years to get back to the starting point. For those who still have a "but" in their heads, I emphasize: a bad teacher can't teach you anything, even in 17 years (I think we could safely approximate this to a lifetime.)

Was I the only one? No, I wasn't. My friends experienced the same frustration, and my classmates endured similar difficulties. Even the younger pupils were not spared from the challenges. Among them was my brother, who is ten years younger than me. He, too, had the misfortune of "learning" from the same "teacher." Later on, he switched schools but unfortunately ended up with an even worse teacher. I did try to advise him to choose a different secondary language, but like me, he wanted to learn German."

Yesterday, I mentioned to him that I had started learning the language again. He gave me a long, deep look, but with all my effort, I couldn't decipher what was happening in his head.

---

'The mind is not a vessel to be filled, but a fire to be kindled.' - Plutarch.