teleren/devto huggingface dataset:
Is Microsoft Azure fundamentals worth IT?
Published: 2022-07-23 06:27:25

**[Microsoft Azure fundamentals](https://cloud-chalktalk.com/azure-training-and-certification/microsoft-azure-fundamentals/)** is an online service that offers massive scalability and availability, making it a great choice for businesses of any size. Azure offers a variety of services, including cloud computing, database hosting and processing, application hosting and processing, operating systems virtualization services and software development tools. With Microsoft Azure becoming one of the most popular platforms today among enterprise customers around the globe because it can be used to build scalable applications in an enterprise environment with the necessary components such as database storage.
155. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-23 06:05:24

```
class MinStack {
 public:
  void push(int x) {
    if (stack.empty())
      stack.emplace(x, x);
    else
      stack.emplace(x, min(x, stack.top().second));
  }

  void pop() {
    stack.pop();
  }

  int top() {
    return stack.top().first;
  }

  int getMin() {
    return stack.top().second;
  }

 private:
  stack<pair<int, int>> stack;  // {x, min}
};

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/min-stack/
1627. Leetcode Solution in Java
Tags: java
Published: 2022-07-23 06:26:54

```
class Solution {
    public List<Boolean> areConnected(int n, int threshold, int[][] queries) {
        int[] parents = new int[n + 1];
        for (int i = 1; i <= n; i++)
            parents[i] = i;
        int max = n / 2;
        for (int i = threshold + 1; i <= max; i++) {
            for (int j = i * 2; j <= n; j += i)
                union(parents, i, j);
        }
        List<Boolean> list = new ArrayList<Boolean>();
        for (int[] query : queries)
            list.add(find(parents, query[0]) == find(parents, query[1]));
        return list;
    }

    public void union(int[] parents, int index1, int index2) {
        parents[find(parents, index1)] = find(parents, index2);
    }

    public int find(int[] parents, int index) {
        while (parents[index] != index) {
            parents[index] = find(parents, parents[index]);
            index = parents[index];
        }
        return index;
    }
}
```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/graph-connectivity-with-threshold/
1553. Leetcode Solution in cpp
Tags: cpp
Published: 2022-07-23 06:25:11

```
class Solution {
    unordered_map<int, int> m;
public:
    int minDays(int n) {
        if (n <= 1) return n;
        if (m.count(n)) return m[n];
        return m[n] = 1 + min(minDays(n / 3) + n % 3, minDays(n / 2) + n % 2);
    }
};
```

#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/minimum-number-of-days-to-eat-n-oranges/
1494. Leetcode Solution in cpp
Tags: cpp
Published: 2022-07-23 06:22:58

```
class Solution {
public:
    int minNumberOfSemesters(int n, vector<vector<int>>& dependencies, int k) {
        /*
        prerequisite of n courses
        if course i is dependent on course j,
        then pre[i]'s jth bit will be set
        */
        vector<int> pre(n);
        
        for(vector<int>& dep : dependencies){
            pre[dep[1]-1] |= (1 << (dep[0]-1));
        }
        
        /*
        key: the combination of courses(bit representation)
        value: minimum days to take all the courses
        */
        vector<int> dp(1<<n, n);
        
        //require 0 days to take 0 courses
        dp[0] = 0;
        
        /*
        need to go into the loop even if cur is 0,
        because in there we will update dp[cur|subnext]!
        */
        for(int cur = 0; cur < (1<<n); ++cur){
            /*
            if we have taken all courses specified by "cur",
            we can take the courses specified by "next"
            */
            int next = 0;
            
            for(int j = 0; j < n; ++j){
                /*
                if we have taken all prerequisites of course "j",
                we can then take course "j" now
                */
                if((cur & pre[j]) == pre[j]){
                    /*
                    cur is the superset of pre[j],
                    that means in current state,
                    we have taken all prerequisites of course j
                    */
                    next |= (1<<j);
                }
            }
            
            /*
            now "next" specify the course we are able to taken,
            but we don't need to take the courses that are already taken
            (which are specified by cur)
            so ""&= ~cur" to exclude those courses
            */
            next &= ~cur;
            
            /*
            https://cp-algorithms.com/algebra/all-submasks.html
            enumerate all the bit 1 combinations(submask)?
            */
            for(int subnext = next; subnext; subnext = (subnext-1) & next){
                if(__builtin_popcount(subnext) <= k){
                    //we can take at most k courses in a day
                    dp[cur|subnext] = min(dp[cur|subnext], dp[cur]+1);
                }
            }
        }
        
        return dp.back();
    }
};

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/parallel-courses-ii
208. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-23 06:12:12

```
struct TrieNode {
  vector<shared_ptr<TrieNode>> children;
  bool isWord = false;
  TrieNode() : children(26) {}
};

class Trie {
 public:
  void insert(const string& word) {
    auto node = root;
    for (const char c : word) {
      const int i = c - 'a';
      if (!node->children[i])
        node->children[i] = make_shared<TrieNode>();
      node = node->children[i];
    }
    node->isWord = true;
  }

  bool search(const string& word) {
    auto node = find(word);
    return node && node->isWord;
  }

  bool startsWith(const string& prefix) {
    return find(prefix) != nullptr;
  }

 private:
  shared_ptr<TrieNode> root = make_shared<TrieNode>();

  shared_ptr<TrieNode> find(const string& prefix) {
    auto node = root;
    for (const char c : prefix) {
      const int i = c - 'a';
      if (!node->children[i])
        return nullptr;
      node = node->children[i];
    }
    return node;
  }
};

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/implement-trie-prefix-tree/
Need help with Bulkswap of Erc20 tokens in Gnosis Chain !!
Published: 2022-07-23 06:02:22

Hi guys i created THCv2 ERC20 token in Gnosis Chain.

the problem is even after liquidity in honeyswap and sushiswap i am not able to swap bulk amounts of the tokens  to other erc20 tokens.

If you guys can help i can negotiate paying thcv2 tokens for your help !!

Thank you !!
232. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-23 06:01:18

```
class MyQueue {
 public:
  void push(int x) {
    input.push(x);
  }

  int pop() {
    peek();
    const int val = output.top();
    output.pop();
    return val;
  }

  int peek() {
    if (output.empty())
      while (!input.empty())
        output.push(input.top()), input.pop();
    return output.top();
  }

  bool empty() {
    return input.empty() && output.empty();
  }

 private:
  stack<int> input;
  stack<int> output;
};

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/implement-queue-using-stacks/
315. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-23 05:51:28

```
class FenwickTree {
 public:
  FenwickTree(int n) : sums(n + 1) {}

  void update(int i, int delta) {
    while (i < sums.size()) {
      sums[i] += delta;
      i += lowbit(i);
    }
  }

  int get(int i) const {
    int sum = 0;
    while (i > 0) {
      sum += sums[i];
      i -= lowbit(i);
    }
    return sum;
  }

 private:
  vector<int> sums;

  static inline int lowbit(int i) {
    return i & -i;
  }
};

class Solution {
 public:
  vector<int> countSmaller(vector<int>& nums) {
    vector<int> ans(nums.size());
    unordered_map<int, int> ranks;
    getRanks(nums, ranks);
    FenwickTree tree(ranks.size());

    for (int i = nums.size() - 1; i >= 0; --i) {
      const int num = nums[i];
      ans[i] = tree.get(ranks[num] - 1);
      tree.update(ranks[num], 1);
    }

    return ans;
  }

 private:
  void getRanks(const vector<int>& nums, unordered_map<int, int>& ranks) {
    set<int> sorted(begin(nums), end(nums));
    int rank = 0;
    for (const int num : sorted)
      ranks[num] = ++rank;
  }
};

```

#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/count-of-smaller-numbers-after-self/
Dell XPS 13 Plus Developer Edition Now Available with Ubuntu 22.04
Tags: tutorial, javascript, webdev, beginners
Published: 2022-07-23 05:22:03

[dell xps 13 with ubuntu 22.04 lts
](https://www.linuxhintbd.xyz/2022/07/dell-xps-13-plus-developer-edition-now-available-with-ubuntu-22-04.html)You’ll be able to buy the Dell XPS 13 Plus Developer Edition pre-loaded with Ubuntu from August, Dell has announced.


What you need to know
The company’s boldly redesigned XPS 13 Plus is also now certified for Ubuntu 22.04 LTS. This means anyone who purchased the laptop with Windows 11 can install Ubuntu 22.04 LTS on it themselves and still benefit from the same hardware-optimizations' that the pre-installed version offers.

What is Ubuntu certification?

“By bringing the enhanced performance and power management features of Ubuntu 22.04 LTS to our most advanced premium laptop, Dell and Canonical reinforce our joint commitment to continue delivering the best computing experience for developers using Ubuntu,” Jaewook Woo, Product Manager at Dell Technologies says.

Dell describes the Dell XPS 13 Plus as its “most powerful 13-inch XPS laptop”, touting up to 2x the performance thanks to its 12th generation Intel core processors.

[New Features and Highlights of Ubuntu 22.04 LTS](https://www.linuxhintbd.xyz/2022/07/dell-xps-13-plus-developer-edition-now-available-with-ubuntu-22-04.html)
More on Number Systems: Working with Base Numbers: Part 1
Tags: beginners, programming, tutorial, computerscience
Published: 2022-07-23 05:28:00

In my [previous post](https://dev.to/ayodejii/enum-flags-in-c-20a6), I talked about working with binary and bitwise operators. I realized that for us to really understand how these operators work, we need to understand two things:
- base numbers
- how the operators work with these numbers under the hood

This post talks about base numbers, and how we come by them.
It is divided into bits (permit my pun), so the post will not be too long and boring.

Base numbers are numbers that are used to represent numeric values on the number system. They are basically numbers. Nothing more. 
They just occur in other bases, the most popular being base10 or **Decimal**.
base 2 is **Binary**
base 8 is **Octal**
base 16 is **HexaDecimal**

The way to represent these bases is by saying n subscript base, e.g., 2 subscript 8 is 2 base 8. I cannot find a way to represent this in this post.
Base 10 numbers do not use these subscripts because we assume all numbers are in base 10 unless specified.
Numbers can occur in many bases, these are just the most common ones.
Base10 numbers are the traditional numbers we are used to: 1, 2, 3...9, 10.

Base numbers follow a pattern. Each base has a maximum representation of that base minus 1. For base 10, it is 9, 2 is 1 and 8 is 7. We are going to exemplify this with base10.
1, 2, ... 8, 9, 10, 11, 12, 13...98, 99, 100, 101 etc.

Notice that when the "numbers" get to 9, they went back to 1 and 0, same as when it got to 99, we added two zeros to the right side of 1. That is how tens, hundreds, thousands, etc. are represented - by the rightmost number.
This same pattern goes for other bases:
2 in base two is 10
8 in base eight is 10
16 in base 16 is 10 etc.

How this works is that the numbers start off as unit, then when you get to the maximum representation, you go to tens, and keep adding 1 till you get to the maximum number again.
That is why:
11 is 11 in base 10
3 is 11 in base 2
9 is 11 in base 8
17 is 11 in base 16.

We are going to learn more about base 2 and base 16 in the next lesson.

**Conversion across Bases**

First, we are going to talk about converting from other bases to base 10, then from 10 to other bases, and then across bases that are not 10.

Conversion from a base to base 10 is straightforward. You just raise each unit of the number to the power of its bases reducing it by index of each unit of the number.

For example, let's convert these numbers to base 10:

- 11 base 8
- 207 base 8
- 11 base 2
- 81 base 4

11 base 8 = 1*8^1 + 1*8^0 = 8 + 1 = 9 base 10
207 base 8 = 2*8^2 + 0*8^1 + 7*8^0 = 64 + 0 + 7 = 71
11 base 2 = 1*2^1 + 1*2^0 = 2 + 1 = 3
81 base 4 = 8*4^1 + 8*4^0 = 32 + 8 = 40 

Please note that ^ represents power e.g. 2^2 is 2*2 = 4, 3^3 is 3*3*3 = 24

This post is, as a matter of fact, more about mathematics than coding, but trust me, you need it to advance in your career as a software developer.
Please stay tuned for the continuation. 😀
System Color Theme Check In JavaScript
Tags: webdev, javascript, css, design
Published: 2022-07-23 05:23:27

A few days back, I was wondering how to know if the system theme is dark or light in web using JavaScript and I found a way to detect that.

In this article, I will share the implementation that I used to check the system theme.

- We will use the method `matchMedia()` provided by the browser's window interface.

- `matchMedia` method expects a `mediaQueryString` as a parameter and it will return a `MediaQueryList` object.

- `MediaQueryList` object will have a property called `matches` of Boolean data type.

## Code

```javascript
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
    // Dark Mode
}
```

`prefers-color-scheme` is a CSS media feature used to detect the system color theme.

We can also have a listener, if user changes the theme in-between.

```javascript
window
   .matchMedia("(prefers-color-scheme: dark)")
   .addEventListener("change", (event) => {
       const theme = event.matches ? "dark" : "light";
   });
```

Let me know in the comments if you are aware of any other way to detect the system theme in web.

---

> Originally published on [blog.bibekkakati.me](https://blog.bibekkakati.me/system-color-theme-check-in-javascript)

---

Thank you for reading 🙏

If you enjoyed this article or found it helpful, give it a thumbs-up 👍

Feel free to connect 👋

[Twitter](https://twitter.com/kakatibibek) | [Instagram](https://instagram.com/bibekkakati) | [LinkedIn](https://linkedin.com/in/bibekkakati)

---

If you like my work and want to support it, you can do it here. I will really appreciate it.

<a href="https://www.buymeacoffee.com/bibekkakati" target="_blank">
<img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=bibekkakati&button_colour=FF5F5F&font_colour=ffffff&font_family=Cookie&outline_colour=000000&coffee_colour=FFDD00">
</a>
Cara agar projek kita dapat diakses melalui domain
Published: 2022-07-23 05:21:00

Jika kalian belum menghubungkan domain pada hosting kalian bisa mengikuti tutorial berikut : [Cara menghubungkan domain ke hosting](https://dev.to/whytrno/cara-menghubungkan-domain-dengan-hosting-untuk-tugas-dpw-f18)

Setelah kita berhasil menghubungkan domain ke dalam hosting, selanjutnya kita akan memasukan projek kita agar dapat di akses melalui domain. Berikut adalah caranya:
**Login ke dalam dashboard hosting** setelah berhasil login ke dalam dashboard, kalian pilih file manager.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bh6ckzq6c21yep6pl86p.png)
**Memasukkan projek**, pada bagian ini kalian pilih domain
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8fsf1657im5fz3kv3qdq.png)
Lalu masuk ke dalam folder berikut
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kllfyczdihdz6kzwx8ev.png)
Lalu kalian klik upload pada bagian sidebar
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oqtnn7awkzrqwc8lfrpv.png)
Lalu upload file zip projek kalian, jika sudah kalian extract file tersebut
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h5oq69f46kh4zkd0eugh.png)
Lalu kalian hapus file index.html
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yy7uogu0xqukx25jlted.png)
Setelah itu, cek domain kalian apakah projek kalian sudah berubah atau belum.  

Lalu selanjutnya kita akan konfigurasi database pada hosting, kalian dapat membaca nya pada link berikut: [Konfigurasi database pada hosting](https://dev.to/whytrno/konfigurasi-database-pada-hosting-5c05)
MySQL + phpMyAdmin Docker Compose
Tags: docker, php, mysql, webdev
Published: 2022-07-23 05:14:00

Here is a simple docker-compose file to run MySQL + phpMyAdmin services for your development needs.

Create a file **docker-compose.yml**.

Copy and paste the below code.

Run it using the command **docker-compose up**.

```
version: "3"

services:
  # Database
  db:
    platform: linux/x86_64
    image: mysql:5.7
    volumes:
      - db_data:/var/lib/mysql
    restart: always
    ports:
      - "3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: yourdb
      MYSQL_PASSWORD: password
    networks:
      - mysql-phpmyadmin

  # phpmyadmin
  phpmyadmin:
    depends_on:
      - db
    image: phpmyadmin
    restart: always
    ports:
      - "8090:80"
    environment:
      PMA_HOST: db
      MYSQL_ROOT_PASSWORD: password
    networks:
      - mysql-phpmyadmin

networks:
  mysql-phpmyadmin:

volumes:
  db_data:
```

You can access the phpMyAdmin at http://localhost:8090/
Cara menghubungkan domain dengan hosting untuk tugas DPW
Published: 2022-07-23 05:10:00

Agar domain kita dapat diakses, kita harus menyambungkan domain yang sudah ada dengan hosting yang tersedia. Untuk melakukannya gunakan cara berikut:

**Membeli domain** disini saya membeli domain pada [hoster.co.id](https://www.hoster.co.id/).
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p2cfg3o4lw2nilaj7nfd.png)

**Setting hosting**, yang pertama kita lakukan setelah membeli domain, kita harus login ke hosting yang telah di berikan oleh Pak Ariq.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r8aqa91b274pkxvf9x4p.png)
Setelah kalian login dan berhasil masuk ke dalam dashboard, kalian pilih **Domain setup**.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2qrh7gf1i4vuxlrwu6q8.png)
Setelah itu kalian ikuti langkah berikut ini:
1. Add new
2. Lalu isi form yang ada
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2r337fj2neilmtvjrv03.png)

**Setting domain**, setelah setting hosting berhasil, kalian kembali ke dashboard lalu pilih **DNS Management**.
Jika sudah dibuka, maka akan terdapat DNS baru seperti berikut
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iwakx1ialcloctd1pbxt.png)
Lalu perhatikan pada data desabanteran.my.id dengan tipe NS, kita akan gunakan NS (Name Server) tersebut untuk menghubungkan domain dengan hosting.
Kembali pada domain anda, silahkan atur nameserver sesuai pada data tadi, seperti berikut
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3zt5cjxo5v086pcjte9p.png)
Setelah itu tunggu beberapa menit hingga terhubung, kalian bisa cek apakah sudah terhubung atau belum dengan memasuki domain kalian.   

Untuk mengatur projek kalian agar dapat digunakan pada domain yang telah anda setting, kalian bisa lihat tutorialnya pada link berikut: [Cara mengakses projek kalian melalui domain](https://dev.to/whytrno/cara-agar-projek-kita-dapat-diakses-melalui-domain-2455)
Carbon successor for c++
Tags: discuss, carbon, cpp, rust
Published: 2022-07-23 00:47:00


Carbon by Google is said to be the successor  to c++
C++ upgrading have been in play since but too much dept to pay , there was so much work that as been done but after much try making a new programming language seems to be a more realistic and attainable goal 
So has of this week Google engineer Chandler Carruth introduced **Carbon**   to be the successor to c++ 
So like every programmer I wanted to see the documentation of carbon to see if it will be a more efficient way to get project done 
A big question popped up in my head after seeing it 

**is it just another system language** 
It solves the problem  that the aging c++ has 
But there are programming language  that do the same thing it is talking about 
I personally use rust on alot of project so am not seeing the major difference  from carbon and rust from the syntax to the logic , there are so much similarities 

So I want to get comments on this 
Reference article  link
> https://www.google.com/url?sa=t&source=web&rct=j&url=https://thenewstack.io/google-launches-carbon-an-experimental-replacement-for-c/&ved=2ahUKEwiYnpmV3435AhWRXsAKHYVcATwQ0PADKAB6BAgEEAE&usg=AOvVaw1HjhOEbZeuUj32vMcIiNac
How To Setup Shopify Store
Tags: shopify, ecommerce, webdev, beginners
Published: 2022-07-23 04:30:00

**Shopify** is one of the popular ecommerce platform which allows businesses to setup online store and to sell their products, Also it helps people to drop ship the products. It is one of those products which get frequent updates and Shopify also has active community support.

We at **Kode It** have started a series on Shopify that will help the beginners to get started with Shopify and to have a A-Z information about Shopify.

You can watch the tutorial by clicking on below shown image or by clicking following link -> [Shopify Store Setup And Account Creation](https://youtu.be/1pAjJ_L9Qxw)


[![How To Create Shopify Store](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4scjo37p89x942b6296x.png)](https://youtu.be/1pAjJ_L9Qxw)
Day 104: Hello material design!
Published: 2022-07-23 00:30:23

Hi!
So today was another day at the office abut it got interesting when I decided to try lookin about design and Figma and ended up landing on Material design. I already was familiar with material design as a design language created by Google but I did explore any deeper than that but as I was looking into some of designs best practices I read more about it and I realized design system are real great way to learn about design and building beautiful interfaces and experiences for users  and today I was able to complete a great two hour course about material designs and I noticed a lot of things that I need to level up on Figma and Ui/UX design in general actually I expect that to be the main focus for the weekend
App size got increased after react native and gradle upgrade
Tags: reactnative, help, android, gradle
Published: 2022-07-23 03:45:57

I upgraded my app's React Native version from 0.63.2 to 0.68, Gradle plugin from 4.0.1 to 7.0.4 , I thought by using higher version of react native and Gradle this will reduce my app's APK size but instead APK's size got increased by 6-7 MB .
What should I do now , my main goal is to have APK of smaller size, is there anything to do in 0.68 RN version so that APK size can get smaller or I should downgrade to 0.63.2 ?

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