teleren/devto huggingface dataset:
Why Data Science?
Tags: beginners, python, codenewbie, datascience
Published: 2022-07-06 04:25:34

   It may be easier to answer "Why not?". Data science plays a major role in our every day lives. From the products and services we all benefit from to the transportation many of us use daily, data science is always found somewhere along the line. It can be used by hobbyists and companies alike to fine tune and optimize many of the things we do, and the skills involved on their own can lead to many amazing opportunities.
    As we move into the future, data science becomes increasingly important. The amount of data we gather increases, and yet we can continue to efficiently parse through it to better our understanding of any number of subjects. Technology is ever evolving to improve our ways of life and propel us to new discoveries, and data as well as how it's used is the backbone of those discoveries and inventions. 
    The possibilities are endless, and each year we become more tech. oriented, more automated, and everywhere possible, our lives are made more efficient. A common theme, an unexpendable aspect behind everything we do, is data. With no one to work with, manipulate, and present that data in a useful way, the quality of our lives would have plateaued and we wouldn't have gotten to see many of the discoveries and advancements that we've been lucky enough to experience. 
    So that is to answer the question, "Why data science?", and why I have decided to start down the path of learning data science. To help understand and gather better insights and knowledge from the information we have available and to explore new possibilities as we learn more every day.
1851. Leetcode Solution in CPP
Tags: cpp
Published: 2022-07-06 10:57:15

```
struct T {
  int size;
  int right;
  T(int size, int right) : size(size), right(right) {}
};

class Solution {
 public:
  vector<int> minInterval(vector<vector<int>>& intervals,
                          vector<int>& queries) {
    vector<int> ans(queries.size(), -1);
    auto compare = [](const T& a, const T& b) { return a.size > b.size; };
    priority_queue<T, vector<T>, decltype(compare)> minHeap(compare);
    vector<vector<int>> qs;

    for (int i = 0; i < queries.size(); ++i)
      qs.push_back({queries[i], i});

    sort(begin(intervals), end(intervals));
    sort(begin(qs), end(qs));

    int i = 0;  // intervals' pointer
    for (const auto& q : qs) {
      while (i < intervals.size() && intervals[i][0] <= q[0]) {
        minHeap.emplace(intervals[i][1] - intervals[i][0] + 1, intervals[i][1]);
        ++i;
      }
      while (!minHeap.empty() && minHeap.top().right < q[0])
        minHeap.pop();
      if (!minHeap.empty())
        ans[q[1]] = minHeap.top().size;
    }

    return ans;
  }
};

```



#leetcode #challenge
here is the link for the problem:
https://leetcode.com/problems/minimum-interval-to-include-each-query/
1719. Leetcode Solution in Java
Tags: java
Published: 2022-07-06 10:56:08

```
class Solution {
    public int checkWays(int[][] pairs) {
        int maxValue = 0;
        for (int[] pair : pairs)
            maxValue = Math.max(maxValue, Math.max(pair[0], pair[1]));
        boolean[][] relations = new boolean[maxValue + 1][maxValue + 1];
        List<Integer>[] lists = new List[maxValue + 1];
        for (int i = 0; i <= maxValue; i++)
            lists[i] = new ArrayList<Integer>();
        for (int[] pair : pairs) {
            int value1 = pair[0], value2 = pair[1];
            relations[value1][value2] = true;
            relations[value2][value1] = true;
            lists[value1].add(value2);
            lists[value2].add(value1);
        }
        List<Integer> indices = new ArrayList<Integer>();
        for (int i = 1; i <= maxValue; i++) {
            if (!lists[i].isEmpty()) {
                indices.add(i);
                relations[i][i] = true;
            }
        }
        Collections.sort(indices, new Comparator<Integer>() {
            public int compare(Integer index1, Integer index2) {
                return lists[index1].size() - lists[index2].size();
            }
        });
        boolean equal = false;
        int rootCount = 0;
        int size = indices.size();
        for (int i = 0; i < size; i++) {
            int j = i + 1;
            while (j < size && !relations[indices.get(i)][indices.get(j)])
                j++;
            if (j < size) {
                if (lists[indices.get(i)].size() == lists[indices.get(j)].size())
                    equal = true;
                for (int value : lists[indices.get(i)]) {
                    if (!relations[value][indices.get(j)])
                        return 0;
                }
            } else
                rootCount++;
        }
        if (rootCount > 1)
            return 0;
        else
            return equal ? 2 : 1;
    }
}
```


#leetcode #challenge
here is the link for the problem:
https://leetcode.com/problems/number-of-ways-to-reconstruct-a-tree/
laragon dan xampp
Published: 2022-07-06 10:53:41

Assalamualaikum wr wb 

Beberapa minggu yang lalu, saya mengikuti kelas bootcamp BWA materi Laravel 9 dan Nuxt 3 yang membutuhkan database menggunakan laragon. Saran dari mas Angga kita menggunakan tool laragon yang katanya lebih mudah digunakan dan merupakan alternative xampp. 
Beberapa keunggulan yang dimiliki laragon ringan, cepat, mudah migrasi dari php 8, 7 dan 5 dst kebawah. Sementara xampp agak susah untuk berpindah dari satu versi php ke php yang lain, mungkin sebagian orang bisa tapi untuk saat ini agak susah melakukan yang demikian tergantung pengalaman.
 
Kemudian saya mulai belajar laragon, instalasi, dan menjalankan laravel 9 menggunakan laragon, awalnya jalan, kemudian stack. Kemudian error kurang lebih seminggu belum nemu solusi perasaan waktu menggunakan xampp mudah alhamdulillah kenapa menggunakan laragon agak susah dan banyak errornya. Stress.
 
Padahal sudah mencari solusi di google, youtube, stackoverflow  tapi belum menemukan solusinya. Akhirnya mikir-mikir lagi ini gimana biar kelar dan kepikiran untuk install ulang xampp.

Kemudian akhirnya uninstall laragon, kemudian install ulang xampp versi baru versi php 8.1 dan alhamdulillah bisa menjalankan laravel 9. 

Demikian cerita saya kesimpulan 
Mungkin seperti ini, kita sibuk mencari semut diujung sana, sementara gajah di depan mata tak dihiraukan. 
Laragon dan Xampp adalah tools dari masih banyak tools yang lain yang bisa digunakan jadi opsional saja, mulailah dengan hal yang mudah bagimu, karena mudah bagi orang lain belum tentu mudah bagi kamu. 

Sekian terimakasih.
1751. Leetcode Solution in CPP
Published: 2022-07-06 10:52:24

```
class Solution {
 public:
  int maxValue(vector<vector<int>>& events, int k) {
    // dp[i][k] := max sum of events[i:] w/ max k # of attendance
    dp.resize(events.size(), vector<int>(k + 1, -1));
    sort(begin(events), end(events));
    return maxValue(events, 0, k);
  }

 private:
  vector<vector<int>> dp;

  int maxValue(const vector<vector<int>>& e, int i, int k) {
    if (k == 0 || i == e.size())
      return 0;
    if (dp[i][k] != -1)
      return dp[i][k];

    // binary search events to find the first index j s.t. e[j][0] > e[i][1]
    const auto it =
        upper_bound(begin(e) + i, end(e), e[i][1],
                    [](int end, const auto& a) { return a[0] > end; });
    const int j = distance(begin(e), it);
    return dp[i][k] =
               max(e[i][2] + maxValue(e, j, k - 1), maxValue(e, i + 1, k));
  }
};

```


#leetcode #challenge
here is the link for the problem:
https://leetcode.com/problems/maximum-number-of-events-that-can-be-attended-ii/
1755. Leetcode Solution in CPP
Tags: cpp
Published: 2022-07-06 10:48:21

```
class Solution {
 public:
  int minAbsDifference(vector<int>& nums, int goal) {
    const int n = nums.size() / 2;
    const vector<int> lNums(begin(nums), begin(nums) + n);
    const vector<int> rNums(begin(nums) + n, end(nums));
    int ans = INT_MAX;
    vector<int> lSums;
    vector<int> rSums;

    dfs(lNums, 0, 0, lSums);
    dfs(rNums, 0, 0, rSums);
    sort(begin(rSums), end(rSums));

    for (const int lSum : lSums) {
      const int i = firstGreaterEqual(rSums, goal - lSum);
      if (i < rSums.size())  // 2^n
        ans = min(ans, abs(goal - lSum - rSums[i]));
      if (i > 0)
        ans = min(ans, abs(goal - lSum - rSums[i - 1]));
    }

    return ans;
  }

 private:
  void dfs(const vector<int>& A, int i, int path, vector<int>& sums) {
    if (i == A.size()) {
      sums.push_back(path);
      return;
    }
    dfs(A, i + 1, path + A[i], sums);
    dfs(A, i + 1, path, sums);
  }

  int firstGreaterEqual(const vector<int>& A, int target) {
    return lower_bound(begin(A), end(A), target) - begin(A);
  }
};

```

#leetcode #challenge
here is the link for the problem:
https://leetcode.com/problems/closest-subsequence-sum/
1771. Leetcode Solution in CPP
Tags: cpp
Published: 2022-07-06 10:47:06

```
class Solution {
 public:
  int longestPalindrome(string word1, string word2) {
    const string& s = word1 + word2;
    const int n = s.length();
    int ans = 0;
    // dp[i][j] := LPS's length in s[i..j]
    vector<vector<int>> dp(n, vector<int>(n));

    for (int i = 0; i < n; ++i)
      dp[i][i] = 1;

    for (int d = 1; d < n; ++d)
      for (int i = 0; i + d < n; ++i) {
        const int j = i + d;
        if (s[i] == s[j]) {
          dp[i][j] = 2 + dp[i + 1][j - 1];
          if (i < word1.length() && j >= word1.length())
            ans = max(ans, dp[i][j]);
        } else {
          dp[i][j] = max(dp[i + 1][j], dp[i][j - 1]);
        }
      }

    return ans;
  }
};

```



#leetcode #challenge
here is the link for the problem:
https://leetcode.com/problems/maximize-palindrome-length-from-subsequences/
CFP for Devoxx Morocco is still open!
Tags: cfp, javascript, java, techtalks
Published: 2022-07-06 10:46:48

Dev community is ambitious and has a lot to say in the Tech field, I highly recommend you to submit your CFP for Devoxx and enjoy this life changing experience, but don't wait too much because there is only a few days left to submit the #DevoxxMA CFP, submit your paper now and let's enjoy Agadir's beautiful sunsets, Moroccan hospitality, good food & great weather🤙
🫵Submit Now: https://dvma22.cfp.dev

https://devoxx.ma/

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hbvdise1le73lnjr468n.jpg)
1782. Leetcode Soluiton in CPP
Tags: cpp
Published: 2022-07-06 10:45:40

```
class Solution {
 public:
  vector<int> countPairs(int n, vector<vector<int>>& edges,
                         vector<int>& queries) {
    vector<int> ans(queries.size());

    // count[i] := # of edges of node i
    vector<int> count(n + 1);

    // shared[i][j] := # of edges incident to i or j, where i < j
    vector<unordered_map<int, int>> shared(n + 1);

    for (const auto& e : edges) {
      const int u = e[0];
      const int v = e[1];
      ++count[u];
      ++count[v];
      ++shared[min(u, v)][max(u, v)];
    }

    vector<int> sortedCount(count);
    sort(begin(sortedCount), end(sortedCount));

    int k = 0;
    for (const int q : queries) {
      for (int i = 1, j = n; i < j;)
        if (sortedCount[i] + sortedCount[j] > q)
          // sortedCount[i] + sortedCount[j] > q
          // sortedCount[i + 1] + sortedCount[j] > q
          // ...
          // sortedCount[j - 1] + sortedCount[j] > q
          // so, there are (j - 1) - i + 1 = j - i pairs > q
          ans[k] += (j--) - i;
        else
          ++i;
      for (int i = 1; i <= n; ++i)
        for (const auto& [j, sh] : shared[i])
          if (count[i] + count[j] > q && count[i] + count[j] - sh <= q)
            --ans[k];
      ++k;
    }

    return ans;
  }
};

```

#leetcode #challenge
here is the link for the problem:
https://leetcode.com/problems/count-pairs-of-nodes/
1793. Leetcode Soluiton in Java
Tags: java
Published: 2022-07-06 10:42:50

```
class Solution {
    public int maximumScore(int[] nums, int k) {
        int length = nums.length;
        int[] left = new int[length];
        int[] right = new int[length];
        Arrays.fill(right, length);
        Deque<Integer> stack = new LinkedList<Integer>();
        for (int i = 0; i < length; i++) {
            while (!stack.isEmpty() && nums[stack.peek()] >= nums[i])
                right[stack.pop()] = i;
            left[i] = stack.isEmpty() ? -1 : stack.peek();
            stack.push(i);
        }
        int score = 0;
        for (int i = 0; i < length; i++) {
            if (left[i] < k && right[i] > k)
                score = Math.max(score, nums[i] * (right[i] - left[i] - 1));
        }
        return score;
    }
}
```
#leetcode #challenge
here is the link for the problem:
https://leetcode.com/problems/maximum-score-of-a-good-subarray
1803. Leetcode Solution in CPP
Tags: cpp
Published: 2022-07-06 10:40:31

```
struct TrieNode {
  vector<TrieNode*> children;
  int count = 0;
  TrieNode() : children(2) {}
};

class Solution {
 public:
  int countPairs(vector<int>& nums, int low, int high) {
    int ans = 0;

    for (const int num : nums) {
      ans += getCount(num, high + 1) - getCount(num, low);
      insert(num);
    }

    return ans;
  }

 private:
  constexpr static int kHeight = 14;
  TrieNode root;
  void insert(int num) {
    TrieNode* node = &root;
    for (int i = kHeight; i >= 0; --i) {
      const int bit = ((num >> i) & 1);
      if (!node->children[bit])
        node->children[bit] = new TrieNode();
      node = node->children[bit];
      ++node->count;
    }
  }

  // # of nums < limit
  int getCount(int num, int limit) {
    int count = 0;
    TrieNode* node = &root;
    for (int i = kHeight; i >= 0; --i) {
      const int bit = ((num >> i) & 1);
      const int bitLimit = ((limit >> i) & 1);
      if (bitLimit == 1) {
        if (node->children[bit])
          count += node->children[bit]->count;
        node = node->children[bit ^ 1];
      } else {
        node = node->children[bit];
      }
      if (!node)
        break;
    }
    return count;
  }
};

```




#leetcode #challenge
Here is the link for the probelm:
https://leetcode.com/problems/count-pairs-with-xor-in-a-range/
vscode QuickFix
Tags: vscode, shortcuts, code
Published: 2022-07-06 10:38:07

`vsCode` dasturida **_quickFix_** funksiyasi ishlamay qolishi dasturchi uchun eng katta fojiya bo'lsa kerak. 

> **QuickFix** - bu `CMD+.`/`CTRL+.` orqali koddagi hatolarga automatik to'g'irlashlar taklif qilish va o'rnida bartaraf etish funksiyasi.

Shu muammoga uchraganlarning dardi malham bo'ladigan maqoladir bu 🤓.

1. `CMD+SHIFT+P` (Windows/Linux uchun `CTRL+SHIFT+P`) ni bosib komandalar oynasini oching.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8j9u9l00p1cpr65nl4kk.png)

2. Ushbu oynada _Keyboard_ deb qidiring va **Open Keyboard Shortcuts**ga bosing.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nsdoxjew0t7pru5houyx.png)

3. Yangi ochilgan oynadan eng yuqoridagi qidiruv bo'limiga **QuickFix** deb qidiring va kichik _qalamcha_ ustiga bosib uni sozlang.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tlc4v8gpcj1txvl9onxg.png)


4. Yozish oynasi chiqgach, `CMD+ENTER` tugmalarini tengidan bosish orqali yangi shortcut yarating. Keyin ENTER tugamsini bosib yakunlang.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2j2yi96kgljhe7yfukw2.png)

### Endi koddagi hatolarni bemalol `CMD+ENTER` tugmalarini bosib hal qila olasiz 🥳🎉.
Pure CSS Girl With Sunglasses
Tags: codepen, html, css, webdev
Published: 2022-07-06 10:30:34

---
title: Pure CSS Girl With Sunglasses
published: true
tags: codepen,html,css,webdev
---

{% codepen https://codepen.io/AsyrafHussin/pen/OJvMRvN %}

<p>Speed Code Video
{% embed https://twitter.com/asyrafhussin4/status/1544623076863664128 %}
The hidden cost of packages and how to avoid it
Tags: composer, npm, packages, webdev
Published: 2022-07-06 10:25:10

---
title: The hidden cost of packages and how to avoid it
published: true
description: My checklist to decide on packages
tags: composer, npm, packages, webdev
---

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

*Packages bring a lot of value: they're reusable components, ready to be downloaded and just work! Magic, right? Needles to say, when I discovered them, I felt like a kid in a candy store. The more the better! Right? right?*

*For experimenting: yes! Of production-ready things: not so much...*

## The hidden cost
Packages bring a hidden, but often use cost with them. Your project becomes dependent on code from someone else. What if you need an update for the new PHP version a year down the line? What if you discover a security risk that needs urgent fixing? These are serious downsides to consider that might not come up immediately.

> **Being dependent on a stale external package can tank your development speed and even whole project!**

On the other hand, avoiding packages all together means you'll miss out on a lot of useful stuff! If your production is shipping to production at some point, you'll want to get the perks and limit the risk of downsides by focussing on high quality, living packages.

## A checklist to minimise the risk
I have a mental checklist to decide on a package and hope to help others by sharing it. Here we go:

### ⭐️ Github stars
The more stars, the more users. Read: a higher amount of people potentially contributing to the project, or taking over when the maintainer lacks time.

### 🕙 Time of the last update in the code
This could tell you a lot about the current state of the project. Is it actively updated? Only bug fixes? Or abandoned (not always mentioned in the readme)?

### ✏️ Documentation
The presence and quality of the documentation will have a huge impact on your development speed.

### 🚩 Issues & pull requests
Are these actively maintained? Do they show known bugs? Is the author open to pull requests for features you want but might not be there yet?


Lastly: A lot of open source maintainers do this entirely voluntary. This comes with a very different set of expectations than when you make use of a paid service. Be kind! And should you wish to do so, they're often happy to receive help on the project. It's a very rare industry where so many people share for free, let's celebrate that!

Happy packaging!
Wednesday Links - Edition 2022-07-06
Tags: java, jvm, gc, http
Published: 2022-07-06 10:23:50

There is no single dependency graph (7 min)📈
https://melix.github.io/blog//2022/07/there-is-no-single-dependency-graph.html

GC, hands off my data! (12 min)✋
https://blog.allegro.tech/2022/06/gc-hands-off-my-data.html

The new HTTP Client API (1 min)🕸️
https://inside.java/2022/06/27/sip057/

Introduction to Project Panama - Part 2: Variadic Functions (6 min)🇵🇦
https://inside.java/2022/06/27/introduction-to-project-panama-part-2/

Virtual Thread Deadlocks (7 min)💀
https://www.javaspecialists.eu/archive/Issue302-Virtual-Thread-Deadlocks.html

Kotlin DataFrame Preview (4 min)🖼️
https://blog.jetbrains.com/kotlin/2022/06/kotlin-dataframe-library-preview/

Groovy Goodness: Closed And Open Ranges (1 min)🎲
https://blog.mrhaki.com/2022/07/groovy-goodness-closed-and-open-ranges.html
What is a deep dive session in Devoxx Morocco?
Tags: javascript, techtalks, java
Published: 2022-07-06 10:11:34

Deep dive sessions are 2 hours sessions where attendees of Devoxx Morocco can rapidly immerse themselves in a subject matter with an in-depth examination of a topic or technology. Take a tour in the website to know more about other session https://devoxx.ma/ and why not to join us in the event :D
Meet new .NET Connectivity Solutions with Support of Visual Studio 2022
Tags: dotconnect, adonet
Published: 2022-07-06 09:52:18

---
title: Meet new .NET Connectivity Solutions with Support of Visual Studio 2022
published: true
description: Devart rolled out updated .NET Connectivity Solutions with Visual Studio 2022 support 
tags: dotconnect, adonet
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
---
Devart, a recognized vendor of world-class data connectivity solutions for various data connection technologies and frameworks, released the new versions of multiple high-performance [ADO.NET data providers](https://www.devart.com/dotconnect/?utm_source=devto&utm_medium=referral&utm_campaign=pr_adonet_06.07.2022), [LinqConnect](https://www.devart.com/linqconnect/?utm_source=devto&utm_medium=referral&utm_campaign=pr_adonet_06.07.2022), and [Entity Developer](https://www.devart.com/entitydeveloper/?utm_source=devto&utm_medium=referral&utm_campaign=pr_adonet_06.07.2022). The key feature of this update is official **Visual Studio 2022 support**.  This allows to use all the Microsoft IDE features that are currently available. 

**The list of improvements includes:**
- The products fully support Windows 11.
- dotConnect for Oracle, MySQL, PostgreSQL, SQLite, and LinqConnect are now compatible with .NET 6 and macOS 11 Arm64.

Visual Studio 2022 support is available for database connectors and dotConnect for Salesforce. 

To learn more about the recent release and download new products, visit: 
https://blog.devart.com/visual-studio-2022-support-in-devart-net-connectivity-solutions.html

**dotConnect** is an enhanced data connectivity solution built over ADO.NET architecture and a development framework with a number of innovative technologies. dotConnect includes high performance data providers for the major databases and popular cloud applications and offers a complete solution for developing data-related applications and web sites.

**About Devart**
 
Devart is one of the leading developers of database tools and administration software, ALM solutions, data providers for various database servers, data integration, and backup solutions. The company also implements Web and Mobile development projects. 
For additional information about Devart, visit https://www.devart.com/.
ReactJS Demo Project - Party Planner Web App - Github
Tags: react, demo, github, javascript
Published: 2022-07-06 09:43:01

This is a party planner Web APP built with React JS to understands the basic features of React JS as well as few advanced concept. Although this project can be enhanced later on as per your requirements.

[Click here for Github Repo ](https://github.com/santosh3700/React-JS-Party-Planner-Web-APP-for-learning-purpose)

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vgb5fqjdc0zi48fl76c0.png)
TOP 10 SITES 🔥
Tags: webdev, beginners, programming, tutorial
Published: 2022-07-06 09:32:04

Top 10 Sites for your career:

1. LinkedIN
2. Indeed
3. Naukri
4. Monster
5. JobBait
6. Careercloud
7. Dice
8. CareerBuilder
9. Jibberjobber
10. Glassdoor

Top 10 Job Skills:

1. Machine Learning
2. Mobile Development
3. SEO/SEM Marketing
4. Data Visualization
5. Data Engineering
6. UI/UX Design
7. Cyber-security
8. Cloud Computing/AWS
9. Blockchain
10. IOT

Top 10 Sites for Online Education:

1. Coursera
2. Udemy
3. DataCamp
4. edX
5. Khan Academy
6. Edureka
7. MIT OpenCourseWare
8. Stanford Online
9. Codecademy
10. Open Culture Online Courses

Top 10 Sites to learn Excel for free:

1. Microsoft Excel Help Center
2. Excel Exposure
3. Chandoo
4. Excel Central
5. Contextures
6. Excel Hero
7. Mr. Excel
8. Improve Your Excel
9. Excel Easy
10. Excel Jet

Top 10 Sites to review your resume for free:

1. Zety Resume Builder
2. Resumonk
3. Resume dot com
4. VisualCV
5. Cvmaker
6. ResumUP
7. Resume Genius
8. Resumebuilder
9. Resume Baking
10. Enhancv

Top 10 Sites for Interview Preparation:

1. Ambitionbox
2. AceTheInterview
3. Geeksforgeeks
4. Leetcode
5. Gainlo
6. Careercup
7. Codercareer
8. InterviewUp
9. InterviewBest
10. Indiabix

Please SHARE and TAG others so that others can also learn.

Follow @keshavgbpecdel (if possible)