teleren/devto huggingface dataset:
Learning Loads
Published: 2023-10-24 20:30:08

Today I was able to learn about validations and creating sample data on the back end of my application. Validations are important useful tool to help ensure that a user includes important information within a required field. For example if you need a certain input from the user to be unique like a username, you can use validations. If we want to validate the presence of something we use validates :body (the_name_of_form_weWantChecked) presence: true Some associations perform validation checks for us. For example having an association belongs_to and the foreign keys associated with this accessor association will preform a automatic check. In short, Foreign keys will automatically be validated. Validations will overall help with security by making sure certain fields must be attended to. Be careful when validating certain fields. I added a validation to my photo models that a fan could only like the comment once but when I added sample data. The sample data would randomly like a photo and sometimes the follower would like the photo twice which violates my validation and caused an error to occur I had to make sure that the follower would only like the photo once with unless photo.fans.include?(follower) which basically says that if the follower has already like the photo they can not do this again which respects my first validation. Learning about validations has been an exciting journey. But I know this is just the tip of the iceberg.
Setting up Tailwind, the easy way
Tags: ember, javascript, tailwindcss
Published: 2023-10-24 20:23:05

---
title: Setting up Tailwind, the easy way
published: true
description: 
tags: ember, javascript, tailwind
cover_image: https://images.unsplash.com/photo-1519060825752-c4832f2d400a?auto=format&fit=crop&q=80&w=2340&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D
# Use a ratio of 100:42 for best results.
# published_at: 2023-10-24 20:19 +0000
---

In the root of your ember app, follow these steps

0. add `tailwindcss` to your `devDependencies` 
0. make a `config/tailwind` folder
1. copy [these files](https://github.com/NullVoxPopuli/ember-apply/tree/main/packages/ember/tailwind/files) to a your `config/tailwind` folder.
2. add `<link integrity="" rel="stylesheet" href="{{rootURL}}assets/tailwind.css">` in your app/index.html
3. add `<link rel="stylesheet" href="{{rootURL}}assets/tailwind.css">` in your tests/index.html
4. add two package.json scripts:
    ```js
  "tailwind:build":
      "npx tailwindcss -c ./config/tailwind/tailwind.config.js -i ./config/tailwind/tailwind-input.css -o ./public/assets/tailwind.css",
  "tailwind:watch": 
      "npx tailwindcss -c ./config/tailwind/tailwind.config.js -i ./config/tailwind/tailwind-input.css -o ./public/assets/tailwind.css --watch"
    ```
5. change your build script
    ```
  "build": "npm run tailwind:build && ember build --environment=production"
    ```
5. add `public/assets/tailwind.css` to your .gitignore file.

🥳 You did it! you're done now!

When you run your app (or build it), you'll run `tailwind:build` or `tailwind:watch' along with your app

---------

or, if you have node 18+, you can automate all this with `npx ember-apply tailwind`


Note that this is an automation of what the [Tailwind CLI](https://tailwindcss.com/docs/installation) documentation guides you through (and what the above 6 steps have you do as well)
Amazon - EC2
Tags: aws, cloudcomputing, beginners, cloudpractitioner
Published: 2023-10-24 19:48:44

        
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xoryp38rrc3s67c2xmcn.png)

## 
EC2 :-
EC2 (Elastic Compute Cloud) is a web service provided by Amazon Web Services (AWS) that offers scalable compute capacity in the cloud. In simpler terms, Amazon EC2 allows you to create and manage virtual servers, known as instances, in the cloud.

## 
Key features and clarifications:

Scalability: You can use EC2 to launch as many or as few virtual servers (instances) as you need and also configure their security, networking, and storage to match your specific requirements.

Elasticity: Amazon EC2 enables you to easily scale up or down the number of instances to meet changes in demand for your applications.

Storage Options: EC2 offers two primary storage options:
(i) EBS (Elastic Block Store) for block storage.
(ii) Instance Store for temporary, instance-specific storage.

Amazon Machine Image (AMI): EC2 allows you to use pre-configured templates known as Amazon Machine Images. These AMIs serve as the foundation for your instances, containing the operating system and other software configurations.

Account Limit: By default, when you create an EC2 account with Amazon, your account is limited to a maximum of 20 instances per EC2 region. This limit can be increased based on your specific use case and AWS support.



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mm6jl3uwe7k1rudd5oz4.jpg)

























General Purpose: (Balanced CPU and RAM)
These instances offer a balanced mix of CPU and memory and are suitable for a wide range of applications.
Example: M5 instances
Compute-Optimized:  (More CPU, less RAM)
These instances are optimized for compute-intensive workloads, offering more CPU power relative to memory.
Example: C5 instances
Memory-Optimized: (More RAM, ample CPU)
These instances are designed for memory-intensive applications, providing a large amount of RAM.

Example: R5 instances


Accelerated Computing (GPU Instances): (GPU-accelerated, offering enhanced graphics processing)
These instances come with GPUs for tasks like machine learning, 3D rendering, and scientific simulations.

Example: P3 instances (for high-performance GPU) or G4 instances (for GPU with cost-efficiency)
Storage-Optimized: (Low-latency storage performance)
These instances are optimized for high-performance storage and low-latency access to storage devices.
Example: I3 instances
High Memory Optimized: (High RAM, suitable CPU)
These instances are tailored for applications that require large amounts of RAM, and they often use the Nitro System architecture.
Example: X1 or X2 instances
Hacktoberfest: PR #4
Tags: opensource, hacktoberfest23, javascript, testing
Published: 2023-10-24 19:40:12

My recent journey led me to [validator.js](https://github.com/validatorjs/validator.js), a popular JavaScript library used for data validation. In this library, an [issue](https://github.com/validatorjs/validator.js/issues/2328) was raised about a bug in the `isInt` function, which game an idea to fix this as well as another function since I thought they might share the same type of logic; the `isFloat` function.

## The Challenge: Bug Hunting in isInt and isFloat

The bug appeared when the options passed to the isInt and isFloat functions were null or undefined. These functions, crucial for checking integer and floating-point values, were not handling these scenarios as gracefully as they should have been. The codebase was very well organized in the source code section and was easy to navigate without much advanced search. However, the test directory - although very easy to navigate with a simple text search - could have been better organized, it would be interesting to see if i could contribute to refactoring the tests section of the codebase to make it easier to understand!

## Solution Part 1: Modifying isInt and isFloat Functions

I modified the `isInt` and `isFloat` functions to handle null and undefined options gracefully. By implementing conditional checks, I made sure that the functions continued to validate integers and floats effectively, regardless of the provided options.

## Solution Part 2: Strengthening the Validation Suite

To validate my modifications and to make sure no other functions break due to the changes since these are core functions which other functions heavily depend on, I expanded the existing test suite. I created new test cases specifically designed to assess the functions’ behavior when null and undefined options are passed through the parameters. These tests served as a safety net, confirming that the modified `isInt` and `isFloat` functions performed flawlessly under a variety of scenarios. These modification can be found in this [pull request](https://github.com/validatorjs/validator.js/pull/2330)

## Open-Source is FUN!!

Contributing to Validator.js was a fun experience that reinforced the spirit of open-source collaboration. By fixing a bug and enhancing the library’s core functions, I hope play a part in empowering developers worldwide with a more robust validation tool.


In the spirit of open source, I encourage fellow developers to join the movement. Whether you’re fixing bugs, adding features, or improving documentation, your contribution matters. Together, we can create a more reliable and efficient digital world, one pull request at a time. Happy hacking!
Spot Trading: Definition & Overview Of Unique Aspects
Published: 2023-10-24 19:34:34

Forex trading offers retail traders a great opportunity with attractive rates and leverage. It has a low entry barrier, and opening an account with an [FX broke](https://liquidity-provider.com/articles/top-5-most-reliable-forex-brokers-of-2022/)r is cost-effective and requires minimal investment. 
In [spot FX trading](https://liquidity-provider.com/articles/forex-liquidity-6-questions-and-tips-how-become-successful-trading/), you can buy or sell foreign exchange at the current rate for immediate delivery without any future settlement. Brokers provide access to the interbank market, allowing traders to trade currency pairs based on research and market behaviour predictions. This enables traders to take advantage of market opportunities, liquidity, and flexibility to speculate on exchange rate movements, manage risks, and conduct international business.
[Spot solution](https://liquidity-provider.com/articles/a-brief-and-comprehensive-guide-to-spot-trading/) is a rapid and efficient way to settle trades and transfer ownership of assets. This makes it ideal for traders who want to take advantage of market shifts or immediate opportunities. It offers flexibility, reduced fees, and access to derivative contracts. However, there are some downsides. You cannot use borrowed funds; there may be market volatility, and hedging options are limited. On the other hand, leveraged trading allows investors to have larger positions with lower initial investments. But it can be risky for inexperienced traders and does not support complex trading techniques.
Comparing Other Tradings
Spot market [trading](https://liquidity-provider.com/articles-trading/) enables traders to open positions with only a tiny percentage of the underlying asset, allowing immediate asset delivery with no minimum investment. Futures traders can profit from liquid markets, which reduce expenses and slippage while charging reduced commissions. Spot trading entails fast transactions with market participants, which ensures asset-based trading and avoids overleveraging. 
Margin trading entails taking positions with collateral or digital assets tied to leverage. Still, it is risky because it requires borrowing funds to grow a trading position beyond what is possible with only the balance. Before beginning to trade, understanding each option’s benefits and drawbacks is critical.
Summary
Many people tend to stay away from the [Forex market](https://liquidity-provider.com/articles/forex-trading-a-beginners-guide/) due to their fear of unknown risks. However, it is essential to understand that the benefits can be pretty advantageous. To consistently profit from this market, traders must possess strong skills and make informed decisions.
Front End Tool for a page
Published: 2023-10-24 19:31:24

Hi,
We have existing ASP.NET (not core) application. My colleague added a page to this using jquery, knockout and checkeditor and talking to back end database and saving data.

Similar requirement came up for me to add another page. But my page needs user interaction like they should be give freedom to add images or videos and I should save entire page content to database. It's like revisions of updates. When ever user want to see historical update, should provide links and clicking on it, should load that version of content including css or design.

I need your suggestion for how to achieve this and add to existing asp.net application.
Is React better or knock out or jquery. Please let me know along with tool names. I am new to front end development.

Thanks,
Spunny
The Science of Color in UI/UX Design: Painting a Masterpiece on the Digital Canvas 🌈
Tags: ui, design, frontend, webdev
Published: 2023-10-24 18:39:26

## Introduction

In the vibrant world of UI/UX design, color isn't just eye candy—it's a powerful tool that can shape user experiences, evoke emotions, and convey brand identity. Let's embark on a journey into the psychology and science behind color choices, unraveling the secrets of creating visually appealing interfaces.

## The Basics: Color Wheel Wisdom 🎨

- **Primary Colors:**
  - Red, blue, and yellow form the foundation of the color wheel.

- **Secondary Colors:**
  - Created by mixing primary colors, like green (blue + yellow) and purple (red + blue).

- **Complementary Colors:**
  - Opposite hues on the color wheel, like red and green, create high contrast.

## The Psychology of Colors: Beyond the Rainbow 🧠

- **Red:**
  - Evokes passion and urgency. Think "Buy Now" buttons.

- **Blue:**
  - Conveys trust and calmness. Social media often sports a calming shade of blue.

- **Yellow:**
  - Radiates warmth and energy. Use sparingly for attention-grabbing elements.

- **Green:**
  - Symbolizes nature and growth. Popular in eco-friendly and health-related designs.

## Color Harmony: Creating Visual Symphonies 🎶

- **Analogous Colors:**
  - Adjacent on the color wheel, like blue, blue-green, and green, for a harmonious vibe.

- **Triadic Colors:**
  - Equally spaced on the wheel, creating a vibrant and balanced palette.

- **Monochromatic Colors:**
  - Different shades of the same color, offering a clean and sophisticated look.

## Accessibility: Making Colors Inclusive 👥

- **Contrast Ratios:**
  - Ensure sufficient contrast for readability, especially for users with visual impairments.

- **Color Blindness Considerations:**
  - Test designs for color blindness using tools like [Color Oracle](https://colororacle.org/).

## Tools of the Trade: Bringing Colors to Life 🛠️

- **Adobe Color Wheel:**
  - Experiment with color schemes and explore different harmonies.

- **Coolors:**
  - Generate cohesive color palettes with a simple click.

- **Contrast Checker by WebAIM:**
  - Verify color contrast ratios for accessibility compliance.

## Conclusion: A Symphony of Pixels and Pigments 🌟

In UI/UX design, color isn't just about aesthetics; it's about communication and connection. Understanding the psychology behind color choices and employing color harmonies leads to interfaces that not only look good but feel right. So, go ahead, wield your digital brush, and paint an unforgettable user experience.

```javascript
const designMasterpiece = () => {
  console.log("May your designs be as vibrant as the colors you choose!");
};

designMasterpiece();
```

> Happy designing! 🚀
HacktoberFest2023 Contributor
Tags: hack23contributor
Published: 2023-10-24 18:31:36

### Hey there 👋🏼,
I am [Abhyudai Shrivastava](https://github.com/itsabhyudai), a contributor in #hacktoberfest2023. It was the first time I participated in HacktoberFest as a contributor. It was a highly enriching experience.

### My contributions:
So, as I was a contributor in this HacktoberFest, I had to make at least 4 contributions by creating pull and merge requests on GitHub. 
I made 4 contributions by writing Python codes of sorting and this was all very exciting to me as I was doing it for the first time. I was also nervous about whether the contributions will get accepted or not. It was all a very exciting thing to do. 
[Contribution-1](https://github.com/itsabhyudai/Hacktoberfest2023-DSA/blob/master/HeapSort.py)
[Contribution-2](https://github.com/itsabhyudai/HactoberFest2023/blob/main/MergeSort.py)
[Contribution-3](https://github.com/itsabhyudai/Hacktoberfest2023-Open-source-/blob/itsabhyudai-patch-1/SelectionSort.py)
[Contribution-4](https://github.com/itsabhyudai/Hacktoberfest2023/blob/itsabhyudai-patch-1/BubbleSort.py)

### What I learned:
As I told that I made contributions by writing Python codes, it enriched my skills in Python as well as I came to know about the sorting algorithms that I was not knowing previously how to code in Python.
ways to Convert values to String
Published: 2023-10-24 18:30:00

{% embed https://www.technilesh.com/2023/10/magic-of-converting-values-to-strings.html %}
# **[Ways to Convert Value to String in JavaScript](https://www.technilesh.com/2023/10/magic-of-converting-values-to-strings.html)**



## The [toString()](https://www.technilesh.com/2023/10/magic-of-converting-values-to-strings.html) Method

One of the most straightforward ways to convert a value to a string in JavaScript is by using the `toString()` method. This method can be applied to various data types, including numbers, booleans, and objects. When you call this method on a value, it returns a string representation of that value. Here's an example:

```javascript
let number = 42;
let stringNumber = number.toString();
console.log(stringNumber); // Outputs: "42"
```

The `toString()` method is particularly handy when working with numbers and dates.

## Using [String Concatenation](https://www.technilesh.com/2023/10/magic-of-converting-values-to-strings.html)

String concatenation is another way to convert a value to a string. This involves joining a value with an empty string. JavaScript's dynamic typing allows you to perform this conversion implicitly. For example:

```javascript
let value = 123;
let stringValue = value + "";
console.log(stringValue); // Outputs: "123"
```

Here, the `value + ""` operation converts the numeric value to a string.

## The [String() Constructor](https://www.technilesh.com/2023/10/magic-of-converting-values-to-strings.html)

JavaScript provides a `String()` constructor that you can use to convert values to strings explicitly. This constructor can handle a wide range of data types and always returns a string. Here's how it works:

```javascript
let value = 3.14;
let stringValue = String(value);
console.log(stringValue); // Outputs: "3.14"

```

The `String()` constructor is versatile and ensures the conversion is explicit and predictable.

## [Template Literals](https://www.technilesh.com/2023/10/magic-of-converting-values-to-strings.html)

Template literals are a modern addition to JavaScript that allow you to create strings with embedded expressions. They are enclosed in backticks (\), and you can embed variables or expressions within ${}. This is a convenient way to convert values to strings, especially when you want to create complex strings. Take a look:

```javascript
let name = "Alice";
let greeting = 'Hello, ${name}!';
console.log(greeting); // Outputs: "Hello, Alice!"


```

Template literals provide a more readable and maintainable way to work with strings.
Survey: trust in LLM apps (incentives include)
Tags: development, ai, machinelearning, azure
Published: 2023-10-24 18:02:14

Hi AI/ML Developers:
We are a group of graduate school students conducting a research survey on practices and needs for evaluating large language models (LLMs). Looking for 10-15 minutes of your time to share your experiences and help improve responsible AI development.

Participants must have direct experience developing or working on applications leveraging large language models. Your insights will be invaluable!

The survey is completely anonymous. As a thank you for your time, we will enter respondents into drawings for one **$20 gift cards** every 10 participants.

To take the survey, please click here: [link](https://forms.gle/D9aWHKq5Nqq7mMfS7)


Thank you for your consideration - your feedback will contribute directly to innovations in responsible and ethical AI! Please feel free to contact msgixgenai@outlook.com with any questions.
What do you say when someone goes to Umrah?
Tags: umrah
Published: 2023-10-24 18:02:02

Umrah allows Muslims to renew their faith ask for pardon pray for their needs and atone for their sins. Umrah is also one of the best ways to be closer to Allah. Every Muslim can accept Allah kind invitation to Umrah. The journey involves ceremonies for emotional mental and physical purification. Its only goal is atonement for past crimes and Ibadah and it is highly valued worldwide. You should get **[all-inclusive Umrah packages](https://www.baitullahtravel.co.uk/umrah-packages.html)** next year.

The majority of Umrah pilgrim’s priorities time with family neighbors friends mentors and educators. Well-wishers should see them before they leave to wish them well offer Salah and embrace them to forget and forgive past hostilities. Perform dua for them if you cannot see them. Since Allah sees no good deed as wasted you can help others while reaping the reward.

**Happy Umrah Mubarak**

As you thank and serve Allah today tomorrow and forever may Allah blessings guide you strengthen your faith and fill your heart with delight. I hope Allah accepts your dua.

**Offer Umrah Pilgrimage to help**

There are several things to do before leaving for Umrah. Help with chores finances or kid care while they away are all options. Determine how to make Umrah travel easier.

**Help them create a list of prayers by providing**

Every Umrah traveller needs duas and prayers. As a well-wisher you can pray for certain travel milestones. Request dua for all their loved ones.

**Request for prayers for you**

Sunnah advises asking family and friends for prayers. When visiting the Kaaba prayers are answered so ask them to pray for you. Muslims visit Makkah to worship Allah.

**Umrah dua for a safe journey**

It is thought that switching Umrahs atones for transgressions between them. Paradise equivalent prizes are also offered by Hajj Mabrur. May your Umrah prayers and sacrifices be accepted? Muslims believe that Allah accepting their Umrah atones for all their sins. You might also pray that Allah SWT makes Umrah easy and returns you safely.

**How do you wish a person made the Umrah?**

May Allah SWT bless your safe and blessed journey to start your wish? Continue praying for their spiritual growth on Umrah. Last tell them you love and wish them well and encourage them.

**Here are some good wishes for individuals performing the Umrah**

As you worship and serve Allah today tomorrow and forever may Allah bless you strengthen your faith and please your heart. I pray Allah hears your dua. You’re lucky to be having fun. Congratulations and best wishes to you and your family on this memorable day.

Wow wonderful news May Allah accept your ziyarat duas and sacrifice. May Allah help you go safely to your family? Please pray for my family on your journey. If you want to conduct Umrah this year get **[December Umrah packages](https://www.baitullahtravel.co.uk/december-umrah-packages.html)**. December is great for Umrah in every way.