teleren/devto huggingface dataset:
Embracing Viewport Height (vh) in CSS over px, rem, and Percentage for Consistent Design Across Screens
Published: 2024-01-05 09:00:11

Cascading Style Sheets (CSS) offer a myriad of units for expressing dimensions, each with its own set of advantages and limitations. In this exploration, we'll delve into the scenario of designing for both extra-large screens, such as laptops, and larger monitors. We'll demonstrate how using viewport height (vh) proves to be a superior choice compared to percentage and fixed units like px and rem. Our journey will be enhanced by leveraging the convenience of Tailwind CSS for seamless implementation.


**The Challenge of Diverse Screen Sizes:**
Imagine you're tasked with creating a visually appealing landing page that needs to look stunning on both a 15-inch laptop and a 27-inch desktop monitor. Using percentage or fixed units may lead to inconsistent designs, with elements appearing too small on the larger screen and too large on the laptop, creating a disjointed user experience.

Example:
```html
<div class="h-50vh bg-blue-500">
  <!-- This div will take up 50% of the viewport height on both screens, maintaining consistency -->
</div>
```

**Responsive Harmony with Viewport Height:**
By adopting viewport height, you ensure that your design elements scale proportionally based on the height of the viewport. This means that whether the user is on a laptop or a larger monitor, the visual experience remains consistent and engaging.

Example:
```html
<section class="h-75vh bg-green-300">
  <!-- This section will take up 75% of the viewport height, providing a consistent appearance across screens -->
</section>
```

**Tailwind CSS Making it Effortless:**
Tailwind CSS's utility classes make incorporating vh into your design a breeze. This is particularly advantageous when faced with the challenge of catering to varying screen sizes, as it allows you to maintain a uniform look and feel without diving into complex CSS calculations.

Example:
```html
<header class="h-20vh bg-gray-800">
  <!-- This header will take up 20% of the viewport height, ensuring a consistent header size on different screens -->
</header>
```

**Avoiding Inconsistencies:**
By relying on viewport height, you sidestep the potential pitfalls of using fixed units like pixels or relative units like percentages. This is especially crucial when dealing with components that are meant to anchor your design, such as headers or hero sections.


In conclusion, in the realm of diverse screen sizes, viewport height emerges as the secret weapon for developers striving for a harmonious and consistent design. The showcased examples, coupled with the developer-friendly nature of Tailwind CSS, underscore how vh efficiently addresses the challenges posed by using percentage or fixed units, especially when dealing with extra-large screens. By integrating vh into your development workflow, you not only simplify your task but also ensure a polished and unified user experience, irrespective of the device in hand.

**Enjoy!**
Kubernetes Scheduler
Published: 2024-01-05 08:55:07

## I. Concepts
### Node labels
When create a node, we can mark some labels for it.
On AWS nodes are assigned by default some labels such as:

```
node.kubernetes.io/instance-type=t3.xlarge
kubernetes.io/arch=amd64
node.kubernetes.io/instance-type=t3.xlarge
```
### Node taints
A node taint lets you mark a node to prevent using it for Pods.

A taint consists of a key, value, and effect.

Available effect values:

- NoSchedule
 - New pods that do not match the taint are not scheduled onto that node.
 - Existing pods on the node remain.

- PreferNoSchedule
 - New pods that do not match the taint might be scheduled onto that node, but the scheduler tries not to.
 - Existing pods on the node remain.

- NoExecute
 - New pods that do not match the taint cannot be scheduled onto that node.
 - Existing pods on the node that do not have a matching toleration are removed.
 - Pods that tolerate the taint and specifies `tolerationSeconds` remain bound for the specified amount of time. After that time elapses, this pod will be evicted.

## II. Assigning Pods to Nodes
There are 2 main ways to schedule a pod into a specific node:

### 1/ nodeSelector (pod) - node labales (node)
`spec.nodeSelector` is a map that specific the node labels that this pod want to be deployed on.

### 2/ toleration (pod) - taint (node)
Pods that have suitable toleration with the node's taint will be scheduled to the node. The matching rule includes the matching key, value, and the valid rule of `effect` described above.

## Reference
- https://www.densify.com/kubernetes-autoscaling/kubernetes-taints/
- https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/
How can display data from a table (patient_category) in the database using php-mysql and codeIgniter?
Tags: beginners, mysql, coding, php
Published: 2024-01-05 08:49:00

To display data from a table (e.g., patient_category) in a MySQL database using CodeIgniter and PHP, you'll need to follow these steps:

**Configure CodeIgniter Database Settings:** Make sure your CodeIgniter application is properly configured to connect to your MySQL database. Set the database connection parameters in the config/database.php file.

**Create a Model:** Create a model to interact with the database. This model will handle querying the patient_category table.

```
// application/models/Patient_category_model.php

class Patient_category_model extends CI_Model {
    public function __construct() {
        parent::__construct();
        $this->load->database();
    }

    public function getPatientCategories() {
        $query = $this->db->get('patient_category');
        return $query->result();
    }
}

```

**Create a Controller:** Build a controller that will load the model and fetch data from the patient_category table.

```
// application/controllers/PatientCategoryController.php

class PatientCategoryController extends CI_Controller {
    public function __construct() {
        parent::__construct();
        $this->load->model('Patient_category_model');
    }

    public function displayPatientCategories() {
        $data['patient_categories'] = $this->Patient_category_model->getPatientCategories();
        $this->load->view('patient_categories_view', $data);
    }
}

```

**Create a View:** Create a view file to display the fetched data (patient_categories_view.php).

```
<!-- application/views/patient_categories_view.php -->

<!DOCTYPE html>
<html>
<head>
    <title>Patient Categories</title>
</head>
<body>
    <h1>Patient Categories</h1>
    <table border="1">
        <tr>
            <th>Category ID</th>
            <th>Category Name</th>
            <!-- Add other table headers as needed -->
        </tr>
        <?php foreach ($patient_categories as $category) { ?>
            <tr>
                <td><?php echo $category->category_id; ?></td>
                <td><?php echo $category->category_name; ?></td>
                <!-- Display other table data fields as needed -->
            </tr>
        <?php } ?>
    </table>
</body>
</html>

```
Access the Controller Method: Finally, access the displayPatientCategories() method of the PatientCategoryController from your browser.

For example, if your CodeIgniter application is running locally: 

```
http://localhost/yourapp/index.php/PatientCategoryController/displayPatientCategories
```
Ensure that you've replaced yourapp with the actual name of your CodeIgniter application directory.

This basic setup will fetch data from the patient_category table and display it in a tabular format using a view file in CodeIgniter. Adjust the view file and database query methods according to your table structure and requirements.

I hope this information will be useful for you. If you have any questions please share with me.

Thanks for reading,
[Dgi Host.com](https://www.dgihost.com)
How to attach a file using JS button(Laravel V8)?
Tags: beginners, programming, laravel, php
Published: 2024-01-05 08:38:36

To attach a file using a JavaScript button in a Laravel v8 application, you can create an input element of type file and trigger its click event when the button is clicked. Here's an example of how you can achieve this:

**Create a button and a hidden file input element in your Blade file:**

```
<!-- Your Blade file content -->
<button id="fileUploadButton">Upload File</button>
<input type="file" id="fileInput" style="display: none;">

```

**Write JavaScript code to handle the button click event and trigger the file input click event:**

```
<!-- Your Blade file content -->

<!-- Your other HTML content -->

<script>
    document.addEventListener('DOMContentLoaded', function() {
        // Get references to the button and file input
        const fileUploadButton = document.getElementById('fileUploadButton');
        const fileInput = document.getElementById('fileInput');

        // Add click event listener to the button
        fileUploadButton.addEventListener('click', function() {
            // Trigger click event on the file input
            fileInput.click();
        });

        // Add change event listener to the file input
        fileInput.addEventListener('change', function() {
            // Once a file is selected, you can perform additional actions if needed
            console.log('File selected:', fileInput.files[0].name);
            // You can also submit the file using AJAX or a form submission here
            // Example: You can use FormData and send the file to the server
            // const formData = new FormData();
            // formData.append('file', fileInput.files[0]);
            // Use fetch or XMLHttpRequest to send formData to your Laravel backend
        });
    });
</script>

```

Handle the file upload in your Laravel backend using routes and controllers.

This code sets up a button that triggers the file input dialog when clicked. Once a file is selected using the file input, the JavaScript code logs the selected file's name to the console. You can further extend the logic inside the change event listener to perform additional actions such as submitting the file to your Laravel backend using AJAX or form submission.

Remember to handle file upload securely on the server-side using Laravel's file handling mechanisms and validate the uploaded file before processing it. Also, customize this code as needed to fit your specific requirements and structure of the Laravel application.

**I hope this information will be useful for you. If you have any questions please share with me.**

Thanks for reading,
[Dgi Host.com](https://www.dgihost.com)
Start Your Online Presence with Web Development Solutions
Published: 2024-01-05 08:14:41

As consumers increasingly turn to internet for information and services, having a well-designed and functional website is non-negotiable. If you're on the lookout for top-notch **[web development solutions](https://www.anayatglobalworks.com/web-development-services)**, look no further than our expert team at Anayat global works.

Our comprehensive **[website development services](https://www.anayatglobalworks.com/web-development-services)** are tailored to meet the unique needs of businesses seeking to make a long lasting impact in the virtual realm. As a leading web development company, we take pride in delivering solutions that not only enhance your online visibility but also contribute to the overall success of your business. With a team of skilled developers and designers, we specialize in creating websites that are not only visually appealing but also user-friendly. We understand the importance of a seamless user experience, and our solutions are crafted to engage your audience and drive conversions.

Searching for a reliable **[web development company near me](https://www.anayatglobalworks.com/web-development-services)**? Our services are not limited by geographical area - we cater to clients globally, offering the same level of expertise and dedication regardless of your location. Our commitment to excellence has earned us a reputation as a trusted partner in the ever-evolving landscape of web development.

In conclusion, professional web development is an investment in the future success of your business. At Anayat global works, we are here to turn your digital dreams into reality. Elevate your online presence and stay ahead of the competition with our unparalleled web development solutions. Contact us today and let's start a journey to transform your online presence.
HOW MY GOOGLE BUSINESS PROFILE AGENCY FAILED
Published: 2024-01-05 08:13:33



HOW MY GOOGLE BUSINESS PROFILE  AGENCY FAILED

My google business profile agency was a service that was meant to take the local businesses in my town onto the internet. 

The local businesses in my town told me they were interested in being seen on the internet, appearing on google maps and being located by strangers just by searching on their phones.

I saw it as an opportunity to market the services of the businesses in my region while making some money for myself.  Infact, anytime I told a business about this idea, they immediately said they were interested and were willing to pay me to help them achieve that.

THE NEXT STEP I TOOK

Realising that this business will work, I went online and got as much information about how I could do this task, I went to a friend's barbering shop to try with his business. 

He surprisingly told me he was so interested and was willing to pay me for whatever my service would cost, as he considered his barbering shop appearing in searches nearby was good for his business.

I set up a gmail account for him using his phone number and google sent the verification text to his phone. Now his gmail account was verified.

HOW THE AGENCY FAILED

Still at my friend's barbering shop, I went ahead and tried to set up his business profile on google so it will appear in online searches and on google maps.

All necessary information was successfully entered UNTIL it was google's turn to send a verification text /phone call to my friend's phone, so that his business would be verified.

google never sent the verification. I went online to research about it and found out that many people have similar issues. Out of all the issues on google's forum that were answered, this particular issue 'google not sending verification text/phone call' was never answered by any google employee.

I did not find any solution to the problem elsewhere.

I tried for days but he never received any text /phone call , while I was with his phone all along to check myself.  

I decided to create a business with my phone and see if google would send a verification to my phone but they didn't either.

How could they easily send a verification as soon as you set up a gmail account, but fail to do so when setting up a business profile?

Since the verification never came, my friend's barbering shop could not showed up online and on google maps.

I realised that I will not be able to help other local businesses too as the verification was not up to me.

So I gave up on my agency.
Machine Learning - The start
Published: 2024-01-05 08:09:46

Hi all, with article i start with learning process of machine learning and AI from very beginning. Lets start from The Machine learning process:

**Data Pre-processing** - This is the starting phase of almost all the new models we build. it mostly has the below common processes.

- Importing the data

- Cleaning the data -> In this we take care of various things like missing data, need of normalization or standardization based on our requirement, encoding categories or labels.

- Splitting the data into training and test sets -> Generally we split our data into 2 sets in which 80% is kept as training set on which our model is trained and 20% is test set on which performance or efficiency of our model is measured.

**Modelling** - In this actual model is build from already present models or ensemble(combination of models) and has the below stages mainly.

- Build

- Train - Our training data set is fed into the model based on which our model gets trained

- Make predictions - Based on training data we are ready to make predictions for unknown data set

**Evaluation** - In this step performance is measured for the model we have built and once we are satisfied with the results we make future predictions using and if not satisfied we repeat the above steps again as its mostly some models work great on some sets of data and some may not perform well .

Hope it give you simple overview of the process, see you next time.
Legacy modernization: Your path to efficiency and growth
Published: 2024-01-05 08:08:27

By modernizing their applications, organizations achieve 30-50% lower application maintenance and running costs. 

Legacy systems are like an anchor that holds your business back, preventing it from reaching its full potential. But it doesn’t have to be that way. Understand what legacy modernization is and start right way.

If you’d like to understand more about our legacy modernization services, check out: [https://bit.ly/46qvUM3](https://bit.ly/46qvUM3)

Read more in our articles:

**Modernize legacy apps to secure your future -** [https://www.softwebsolutions.com/resources/modernize-legacy-application.html](https://www.softwebsolutions.com/resources/modernize-legacy-application.html)

**AWS for application modernization - ** [https://go.softwebsolutions.com/resources/aws-for-app-modernization.html](https://go.softwebsolutions.com/resources/aws-for-app-modernization.html)
Setting Up Node Version Manager (NVM) on Arch Linux -Garuda Linux(Dragonized KDE)
Published: 2024-01-05 08:02:09

If you’re diving into Node.js development on Garuda Linux Dragonized KDE, this guide simplifies the process of setting up Node Version Manager (NVM). This straightforward tutorial will help you swiftly install NVM using curl, ensuring a hassle-free environment for managing your Node.js versions.

**Step 1: Check Current Shell and Switch to Bash**

Before proceeding with the Node Version Manager (NVM) installation, it’s essential to ensure that you are currently using the bash shell. In the terminal, type the following command to switch to the bash shell:

```
bash
```
This ensures that you are using the bash terminal for the subsequent steps in setting up Node Version Manager (NVM) on Garuda Linux Dragonized KDE.

**Step 2: Install NVM with Curl**

Use curl to download and run the NVM installation script:

```
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

```

**Step 3: Resolve “Failed to connect” Error**

If you encounter a connection error, update your /etc/hosts file:

1.Open the hosts file with nano:

```
sudo nano /etc/hosts
```
2.Add the IP address at the end:

```
185.199.108.133 raw.githubusercontent.com
```
3.Save and close (Ctrl + X, Y, Enter).
4.Retry the NVM installation command:

```
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
```

**Step 4: Complete NVM Installation**

Close and reopen the terminal.Verify the installation after switching to bash shell.

```
bash
nvm --version
```
**Conclusion**

You’ve efficiently set up Node Version Manager on Garuda Linux, enabling seamless management of Node.js versions. Happy coding!
🚀 Empowering Success Through Strategic Data Management Services 🚀
Published: 2024-01-05 08:01:32

In today's data-driven landscape, success hinges on the effective management and utilization of information. 💡

At Softweb Solutions, we're dedicated to empowering businesses to harness the full potential of their data through our strategic data management services. 🌐

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

Our approach goes beyond mere storage – we craft tailored strategies that optimize data collection, analysis, and interpretation. By doing so, we help our clients make informed decisions, enhance operational efficiency, and drive growth. 📈💼

From developing robust data architectures to implementing cutting-edge analytics tools, we're committed to ensuring that your data becomes a valuable asset, fueling your journey towards success. 💪

Ready to unlock the power of your data? Reach out to us today to learn more about how our data management services can elevate your business to new heights! 🚀✨

#DataManagement #BusinessGrowth #DataStrategy #Success #Innovation #Empowerment #Analytics #DecisionMaking
Cloud Computing
Published: 2024-01-04 08:06:00

In the ever-evolving landscape of technology, cloud computing stands as a beacon of efficiency, offering on-demand access to a spectrum of computing resources over the Internet. This paradigm shift from traditional server setups has reshaped how businesses approach IT infrastructure, bringing forth a multitude of benefits.

Key Aspects of Cloud Computing

Cloud computing encompasses a variety of services, including applications, servers (both physical and virtual), data storage, and development tools. These services are hosted in remote data centres managed by cloud service providers, enabling users to access and utilize resources based on consumption, leading to cost-effective solutions.

Benefits Of Traditional Setups

1. Lower IT Costs:
   - Offloads the burden of purchasing, installing, and setting up infrastructure.

2. Improve Agility and Time-to-Value:
   - Allows for rapid deployment and utilization of enterprise applications in minutes.

3. Scale More Easily and Cost-Effectively:
   - Facilitates seamless scalability without the need for excess capacity or hardware-based maintenance.

Cloud Computing Services

1. SAAS (Software as a Service)
   - Cloud-based software or applications accessible through a web browser or dedicated client.
   - Offers automatic updates and data protection, ensuring data integrity even in the event of device failures.

2. PAAS (Platform as a Service)
   - Provides a complete software stack, infrastructure, and development tools for running and managing applications.
   - Developers can focus on application development without the complexity of maintaining the underlying platform.

3. IAAS (Infrastructure as a Service)
   - On-demand access to fundamental computing resources—physical and virtual servers, networking, and storage.

Types of Cloud Computing

1. Public Cloud
   - Resources provided by cloud service providers (e.g., AWS, GCP, Azure) on a shared infrastructure.
   - Suitable for a wide range of users and applications.

2. Private Cloud
   - Entire infrastructure dedicated to and accessible by a single consumer.
   - Chosen for its enhanced security, ideal for confidential projects.

3. Hybrid Cloud
   - Combination of public and private clouds, offering flexibility in running organizational workloads.

4. Multi-Cloud or Hybrid Multi-Cloud
   - Utilizes two or more cloud services to avoid vendor lock-in and provide a broader range of services.

In conclusion, cloud computing is a transformative force, offering not just a shift in infrastructure but a paradigm that empowers businesses to scale, innovate, and secure their digital futures. Understanding its nuances is key to unlocking its full potential.
Llmlingua + LlamaIndex + RAG = Cheaper Chatbot
Published: 2024-01-05 07:52:53

in this post, I will be showing you step-by-step how to create your Ai chatbot and on top of that I am going to show you how to reduce the cost of tokens and decrease API response latency

On December 7th, Microsoft researchers announced “LLMLingua,’’ a new technology that highly compresses prompts given to large-scale language models (LLMs).

LLMLingua Innovating LLM efficiency with prompt compression.’’ To extract more accurate answers from LLM, the input prompts tend to become longer prompt.

 LLMLingua allows you to significantly shorten long prompts while retaining their meaning.

in this Post, we will cover what is LLMlingua, what its its key features and functionalities, and how to implement LLMlingua with LlamaIndex and Rag to develop a cost-effective chatbot solution.

the full article can be found [here](https://quickaitutorial.com/llmlingua-llamaindex-rag-cheaper-chatbot/)