teleren/devto huggingface dataset:
786. K-th Smallest Prime Fraction
Tags: php, leetcode, algorithms, programming
Published: 2024-05-10 15:45:46

786\. K-th Smallest Prime Fraction

Medium

You are given a sorted integer array `arr` containing `1` and **prime** numbers, where all the integers of `arr` are unique. You are also given an integer `k`.

For every `i` and `j` where `0 <= i < j < arr.length`, we consider the fraction `arr[i] / arr[j]`.

Return _the <code>k<sup>th</sup></code> smallest fraction considered. Return your answer as an array of integers of size `2`, where `answer[0] == arr[i]` and `answer[1] == arr[j]`_.

**Example 1:**

- **Input:** arr = [1,2,3,5], k = 3
- **Output:** [2,5]
- **Explanation:** The fractions to be considered in sorted order are:\
  1/5, 1/3, 2/5, 1/2, 3/5, and 2/3.\
  The third fraction is 2/5.

**Example 2:**

- **Input:** arr = [1,7], k = 1
- **Output:** [1,7]


**Constraints:**

- `2 <= arr.length <= 1000`
- `1 <= arr[i] <= 3 * 104`
- `arr[0] == 1`
- `arr[i]` is a **prime** number for `i > 0`.
- All the numbers of `arr` are **unique** and sorted in **strictly increasing** order.
- `1 <= k <= arr.length * (arr.length - 1) / 2`

**Follow up:** Can you solve the problem with better than <code>O(n<sup>2</sup>)</code> complexity?

**Solution:**

```
class Solution {

    /**
     * @param Integer[] $arr
     * @param Integer $k
     * @return Integer[]
     */
    function kthSmallestPrimeFraction($arr, $k) {
        $n = count($arr);
        $l = 0.0;
        $r = 1.0;

        while ($l < $r) {
            $m = ($l + $r) / 2.0;
            $fractionsNoGreaterThanM = 0;
            $p = 0;
            $q = 1;

            for ($i = 0, $j = 1; $i < $n; ++$i) {
                while ($j < $n && $arr[$i] > $m * $arr[$j])
                    ++$j;
                if ($j == $n)
                    break;
                $fractionsNoGreaterThanM += $n - $j;
                if ($p * $arr[$j] < $q * $arr[$i]) {
                    $p = $arr[$i];
                    $q = $arr[$j];
                }
            }

            if ($fractionsNoGreaterThanM == $k)
                return [$p, $q];
            if ($fractionsNoGreaterThanM > $k)
                $r = $m;
            else
                $l = $m;
        }

        throw new Exception("Kth smallest prime fraction not found.");
    }
}
```


**Contact Links**

- **[LinkedIn](https://www.linkedin.com/in/arifulhaque/)**
- **[GitHub](https://github.com/mah-shamim)**
How to classify monkeys images using convolutional neural network , Keras tuner hyper parameters (part3)
Tags: python, tensorflow, image, imageclassification
Published: 2024-05-10 15:26:33

Video 3: Enhancing Classification with Keras Tuner:
🎯 Take your monkey species classification to the next level by leveraging the power of Keras Tuner. 
So , how can we decide how many layers should we define ? how many filters in each convolutional layer ?
Should we use Dropout layer ? and what should be its value ?
Which learning rate value is better ? and more similar questions.

Optimize your CNN model's hyperparameters, fine-tune its performance, and achieve even higher accuracy. 
Learn the potential of hyperparameter tuning and enhance the precision of your classification results.

This is the link for part 3: https://youtu.be/RHMLCK5UWyk&list=UULFTiWJJhaH6BviSWKLJUM9sg

I shared the a link to the Python code in the video description.

This tutorial is part no. 3 out of 5 parts full tutorial : 
🎥 Image Classification Tutorial Series: Five Parts 🐵
In these five videos, we will guide you through the entire process of classifying monkey species in images. We begin by covering data preparation, where you'll learn how to download, explore, and preprocess the image data. 
Next, we delve into the fundamentals of Convolutional Neural Networks (CNN) and demonstrate how to build, train, and evaluate a CNN model for accurate classification. 
In the third video, we use Keras Tuner, optimizing hyperparameters to fine-tune your CNN model's performance. Moving on, we explore the power of pretrained models in the fourth video, 
specifically focusing on fine-tuning a VGG16 model for superior classification accuracy. 
Lastly, in the fifth video, we dive into the fascinating world of deep neural networks and visualize the outcome of their layers, providing valuable insights into the classification process


Enjoy
Eran

#Python #Cnn #TensorFlow #Deeplearning #basicsofcnnindeeplearning #cnnmachinelearningmodel #tensorflowconvolutionalneuralnetworktutorial
Day 40/366
Tags: 1percentplusplus, 100daysofcode
Published: 2024-05-10 15:07:41

🚀 **Today's Learning:**

🌟 DSA
- Remove outermost parenthesis
- Palindrome check

🌟 Dev
- Asynchronous behaviour of NodeJS

🔍 **Some Key Highlights:**

DSA

In the "Remove outermost parenthesis" code, we iterate through each character of the input string, keeping track of the count of open and close parentheses. We only add characters to the result string if they are not the outermost parentheses. The outermost parentheses are identified by the count of open and close parentheses being equal and the count being zero at the end. 

For the "Palindrome check" code, we compare characters from the beginning and end of the input string simultaneously, moving inward until we reach the middle. If at any point the characters don't match, we conclude that the string is not a palindrome. If all characters match, the string is a palindrome.

DEV

In Node.js, asynchronous behavior allows tasks to be executed concurrently without waiting for previous tasks to complete. This is achieved using non-blocking I/O operations and event-driven architecture. When a task requiring I/O operation is encountered, Node.js delegates it to the system, and meanwhile, continues executing other tasks. Once the I/O operation is completed, a callback function is triggered to handle the result. This asynchronous model ensures efficient utilization of system resources and enables Node.js to handle large numbers of concurrent connections effectively.

 #100daysofcode #dsa #coding
Accelerate Model Training with PyTorch
Tags: machinelearning, ai, datascience, performance
Published: 2024-05-10 15:18:44

Hello everyone! My name is Maicon Melo Alves and I'm a High Performance Computing (HPC) system analyst specialized in AI workloads.  

I would like to announce that my book "Accelerate Model Training with PyTorch 2.X: Build more accurate models by boosting the model training process" was recently launched by Packt. 

This book is for intermediate-level data scientists, engineers, and developers who want to know how to use PyTorch to accelerate the training process of their machine-learning models.

You can get it at Amazon on this link: https://a.co/d/iTADiEF

If you think this book can help other professionals, please share this post with your community! 😊 

Thank you very much!
Scop in Javascript.
Tags: javascript, programming, beginners, developer
Published: 2024-05-10 15:12:49

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

JavaScript, renowned for its versatility, stands as a pivotal language in the realm of web development. Core to its essence lies the concept of scope, delineating the reach of variables, functions, and objects within a codebase. In this discourse, we delve into the nuanced dimensions of scope in JavaScript, encapsulating global scope, local scope, and function scope, complemented by illustrative examples to illuminate their workings.

### Global Scope

Global scope encompasses variables, functions, and objects accessible from any part of a program, having their origins outside any encapsulating function or code block. Take, for instance, the following snippet:

```javascript
let globalVariable = "Hello, World!";

function myFunction() {
  console.log(globalVariable); // Output: "Hello, World!"
}

console.log(globalVariable); // Output: "Hello, World!"
```

Here, `globalVariable` is globally defined, thus accessible both within `myFunction` and beyond, exemplifying the unrestricted nature of global scope.

### Local Scope

Contrarily, local scope confines variables, functions, and objects to specific code blocks, like an `if` statement or a `for` loop. Witness this in action:

```javascript
if (true) {
  let localVariable = "Hello, World!";
  console.log(localVariable); // Output: "Hello, World!"
}

console.log(localVariable); // Throws an error: localVariable is not defined
```

In this scenario, `localVariable` finds existence solely within the confines of the `if` statement, inaccessible beyond its territorial borders.

### Function Scope

Function scope relegates variables, functions, and objects to the confines of a particular function, rendering them inaccessible outside its precincts. Behold:

```javascript
function myFunction() {
  let functionVariable = "Hello, World!";
  console.log(functionVariable); // Output: "Hello, World!"
}

console.log(functionVariable); // Throws an error: functionVariable is not defined
```

Here, `functionVariable` finds sanctuary solely within `myFunction`, beyond the grasp of external scopes, delineating the essence of function scope.

In summation, mastery of scope in JavaScript stands as a cornerstone for crafting elegant, effective, and maintainable codebases. Global scope affords ubiquitous access, local scope offers compartmentalization within code blocks, and function scope provides encapsulation within functions, collectively weaving the intricate fabric of JavaScript's scoping paradigm.
The Scope of Variables
Tags: java, programming, learning, beginners
Published: 2024-05-10 14:40:21

The scope of a variable is the part of the program where the variable can be referenced. A variable defined inside a method is referred to as a local variable. The scope of a local variable starts from its declaration and continues to the end of the block
that contains the variable. A local variable must be declared and assigned a value before it can be used.

A parameter is actually a local variable. The scope of a method parameter covers the entire method. A variable declared in the initial-action part of a **for**-loop header has its scope in the entire loop. However, a variable declared inside a **for**-loop body has its scope limited in the loop body from its declaration to the end of the block that contains the variable, as shown below:

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

You can declare a local variable with the same name in different blocks in a method, but you cannot declare a local variable twice in the same block or in nested blocks, as shown below:

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

A variable can be declared multiple times in non-nested blocks, but only once in nested blocks. 

Do not declare a variable inside a block and then attempt to use it outside the block.
Here is an example of a common mistake:

```
for (int i = 0; i < 10; i++) {
}
System.out.println(i);
```

The last statement would cause a syntax error, because variable **i** is not defined outside of the **for** loop.
Unveiling the Timeless Elegance of Harding's Design: A Fusion of Tradition and Modernity
Published: 2024-05-10 14:39:58

In [the realm of design](Https://www.ajhardingdesigns.com), where trends often come and go like fleeting whispers, Harding's Design stands as a bastion of timeless elegance, seamlessly blending tradition with modernity. With a rich history spanning decades, Harding's Design has carved a niche for itself, captivating enthusiasts and aficionados alike with its signature style and unwavering commitment to excellence.
Rooted in Tradition:

[At the heart of Harding's Design lies a deep reverence for tradition](Https://www.ajhardingdesigns.com). Drawing inspiration from the rich tapestry of historical design movements, each creation exudes a sense of heritage and authenticity. From ornate motifs reminiscent of Art Nouveau to the clean lines of Mid-Century Modernism, Harding's Design pays homage to the masters of the past while infusing every piece with a contemporary twist.

Craftsmanship Beyond Compare:

Central to the allure of Harding's Design is its unwavering dedication to craftsmanship. Meticulously handcrafted by skilled artisans, each piece is a testament to the timeless artistry that defines the brand. Whether it's a finely carved wooden chair or an intricately woven tapestry, every detail is executed with precision and care, resulting in objects of unparalleled beauty and quality.

Innovation Meets Tradition:

While rooted in tradition, Harding's Design is not afraid to embrace innovation. By seamlessly integrating cutting-edge technologies and materials into their creations, the brand pushes the boundaries of what is possible while staying true to its core values. The result? Designs that are not only visually stunning but also functional and forward-thinking, standing the test of time in an ever-evolving world.

A Legacy of Excellence:

As a beacon of excellence in the world of design, Harding's Design has left an indelible mark on the industry. From prestigious awards to glowing reviews from critics and clients alike, the brand's commitment to quality and innovation has earned it a place among the elite. But perhaps the true measure of Harding's Design's success lies in the countless homes and spaces it has transformed, each one imbued with the timeless elegance that is the hallmark of the brand.

In conclusion, Harding's Design represents more than just a collection of furniture and decor. It is a celebration of tradition, craftsmanship, and innovation—a testament to the enduring power of design to inspire, uplift, and enchant. So whether you're furnishing a new home or simply seeking to add a touch of elegance to your space, look no further than Harding's Design. For in each piece lies a story waiting to be told, a legacy waiting to be passed down through generations.
Navigating the Rapids: A Junior Developer's Journey Through Challenges and Growth
Tags: webdev, developer, programming, angular
Published: 2024-05-10 14:38:24

As a freshly minted junior developer, stepping into the professional realm felt like diving into the deep end of a pool without knowing how to swim. The excitement of finally applying my skills in a real-world setting was palpable, but so was the overwhelming sense of apprehension. Two months into my journey, I've already encountered a plethora of challenges, each one pushing me to grow and learn in ways I never anticipated.

One of the most daunting hurdles I faced early on was grappling with a massive codebase. The sheer size and complexity of the project left me feeling lost in a labyrinth of functions and modules. Understanding the flow of the code and its various components felt akin to deciphering hieroglyphics. However, I soon realized that unraveling this tangled web was an essential part of the learning process.


Another significant challenge was navigating the integration of endpoints. Coming from a primarily academic background, my experience with real-world APIs and endpoints was limited. As I delved into the task assigned to me, I found myself swimming in unfamiliar waters, struggling to make sense of RESTful architectures and HTTP requests. It was a humbling experience to realize that theoretical knowledge only took me so far, and there was still so much to learn in practice.

Despite my best efforts, I encountered a bug that had me stumped for days. I thought I had fixed it, only to have my hopes dashed when the issue resurfaced. Frustration threatened to overwhelm me as I wrestled with the problem, but then came a turning point. I reached out to my boss for guidance, swallowing my pride and admitting that I needed help. To my surprise, instead of chastising me for my shortcomings, my boss patiently walked me through the debugging process, offering insights and strategies that I had never considered. Together, we finally managed to squash the elusive bug, and in the process, I gained invaluable lessons that no classroom could teach.

Reflecting on these challenges, I realized that the journey of a developer is not a sprint but a marathon. It's a continuous cycle of facing obstacles, learning from them, and emerging stronger on the other side. Every bug fixed, every endpoint mastered, and every line of code written is a testament to my growth and resilience.

Yes, the road ahead is long and fraught with challenges, but it's a journey that I'm wholeheartedly committed to. With each passing day, I become more adept at navigating the rapids of software development, armed with newfound knowledge and the unwavering determination to succeed. And as I continue on this path, I know that every obstacle I overcome brings me one step closer to realizing my full potential as a developer.
AIScraper | AI-powered scraper solutions
Published: 2024-05-10 14:36:45


Discover the capabilities of AIScraper through its browser extension, developer-friendly API, or by creating your own custom AI-powered scraper. With the AIScraper Extension, effortlessly extract structured data from any website with just a few clicks. Request data in natural language or ask AI to generate selectors for precise results within seconds. AIScraper offers tailored data scraping solutions for every industry, including market researchers, recruiters, product managers, sales managers, and real estate agents, ensuring efficient and accurate data extraction for diverse needs.
100 Common Flutter widget list
Tags: flutter, dart, widget, android
Published: 2024-05-10 14:32:56


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vyymt0q14f8yohfrb8qy.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qownex7svzy1ncqaw5po.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dym4lwsz2ngyasnzr4m3.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9veod63bferiaj36hpq8.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h311p1wu6ytew2vxpfbu.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rxg46j3rklwqxmtnk8w3.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yj9r8ly4b9a8qpgxbj8n.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j0y5c5k0dszrg8l7vwmt.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7hwraf1eipcrl6nhadxk.png)
10 Incredible Manga Comic Transformations
Tags: vyvymanga
Published: 2024-05-10 14:28:55

Certainly! Here are 10 incredible manga comic transformations [VyvyManga](https://vyvymangaaa.com/):

1. **Goku (Dragon Ball)**: Goku undergoes multiple transformations throughout the "Dragon Ball" series, including the iconic Super Saiyan transformations, each marked by a surge in power and a change in appearance, with golden hair and intense energy.

2. **Luffy (One Piece)**: Luffy's transformations in "One Piece" include his Gear Second and Gear Third techniques, where he boosts his speed and strength respectively by manipulating his body's blood flow and bone structure.

3. **Eren Yeager (Attack on Titan)**: Eren undergoes several dramatic transformations in "Attack on Titan," including his ability to transform into a Titan himself, leading to significant changes in his appearance and abilities.

4. **Ichigo Kurosaki (Bleach)**: Ichigo's transformations in "Bleach" include his various forms as a Soul Reaper, Hollow, and later, his Visored form, each with distinct abilities and appearances reflecting his evolving powers.

5. **Naruto Uzumaki (Naruto)**: Naruto's transformations in "Naruto" include his use of the Nine-Tails' chakra to access various forms, such as his iconic Nine-Tails Chakra Mode and later, his complete Nine-Tails transformation.

6. **Midoriya Izuku (My Hero Academia)**: Midoriya's transformation in "My Hero Academia" comes with his acquisition of One For All, a powerful Quirk passed down from generation to generation, resulting in physical changes and enhanced abilities.

7. **Ken Kaneki (Tokyo Ghoul)**: Kaneki's transformation in "Tokyo Ghoul" occurs when he becomes a half-ghoul after a ghoul organ transplant, leading to a physical and psychological metamorphosis as he grapples with his newfound identity.

8. **Edward Elric (Fullmetal Alchemist)**: Edward's transformation in "Fullmetal Alchemist" involves the use of alchemy to transmute his own body parts, particularly his automail limbs, as well as his utilization of the Philosopher's Stone for temporary enhancements.

9. **Tanjiro Kamado (Demon Slayer: Kimetsu no Yaiba)**: Tanjiro's transformation in "Demon Slayer" is more subtle but no less impactful, as he undergoes intense training and gains mastery over breathing techniques, resulting in enhanced combat skills and abilities.

10. **Saitama (One Punch Man)**: Saitama's transformation in "One Punch Man" is more of a comedic take, as he undergoes a physical transformation from an ordinary man to a bald, unbeatable superhero with limitless strength, albeit with the drawback of feeling unfulfilled due to his overwhelming power.

These manga comic transformations showcase the characters' growth, evolution, and newfound powers, adding depth and excitement to their respective stories.

For More Read Our Blog on:
https://malikchris.tumblr.com/
https://vyvymangaaa.blogspot.com/2024/01/read-manga-online-free-at-vyvymanga.html
These IT teams love to get technical
Tags: productivity, opensource, learning
Published: 2024-05-10 14:19:29

What do these three IT teams have in common?

Answer: They all went looking for a project management system, found one, and it was... open source!

When they got tired of putting together random tools to understand and DO their daily work, weekly plans, and monthly roadmaps, they looked for an all-in-one project management system. 

And, we know IT loves to get technical! So, it didn't hurt that OpenProject is open source and easy for them to [get up and running to test out](https://start.openproject.com/).

After using it a bit, they realized they could throw the random tools out and share ONE great system for organizing and managing tasks with their whole team.

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

[Read the interview](https://www.openproject.org/blog/project-management-software-osi/) with Nick at OSI.


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

[Read the interview](https://www.openproject.org/blog/temple-uni-blog/) with Brent at Temple University.


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

[Read about this healthcare team](https://www.openproject.org/blog/unitycomcare/) from our chat with Daniel.

{% embed https://youtu.be/6O_REElI1hs?si=VlharUIQTEqBCj_N %}
All in One Connection and Growth Tool for Creators
Tags: socialmedia, biolink, marketing, saas
Published: 2024-05-10 14:16:25

Pushbio is an all in one link-in-bio tool that maximizes online visibility and engagement for content creators, digital entrepreneurs, and small businesses. It allows users to integrate content from various social media platforms into one dynamic page. Key features include lead collection, email broadcasting, follower growth through missions and loyalty rewards, and the ability to host giveaways directly from the bio link. Pushbio also supports setting up a comprehensive online store to sell digital products, merch, courses, and more, with seamless payment integrations.
Additionally, Pushbio enhances networking and marketing efforts with its QR Code generator, Virtual Business Cards, and efficient Link Shortener. Pushbio is designed to streamline digital operations and facilitate robust brand growth and collaboration opportunities.