teleren/devto huggingface dataset:
Python challenge_11
Tags: challenge, python, beginners, programming
Published: 2021-11-11 16:20:34

##Tic tac toe input
###level of challenge 4/10

- Here's the backstory for this challenge: 
- imagine you're writing a tic-tac-toe game, where the board looks like this:
```    
    1:  X | O | X
        -----------
    2:    |   |  
        -----------
    3:  O |   |
        A   B  C
```
The board is represented as a 2D list:
```
board = [
    ["X", "O", "X"],
    [" ", " ", " "],
    ["O", " ", " "],
]
```

- Imagine if your user enters "C1" and you need to see if there's an X or O in that cell on the board.
- To do so, you need to translate from the string "C1" to row 0 and column 2
- so that you can check board[row][column].

- Your task is to write a function that can translate from strings of length 2 to a tuple (row, column).
- Name your function get_row_col.
- it should take a single parameter which is a string of length 2 consisting of an uppercase letter and a digit.

For example:

- Calling get_row_col("A3") should return the tuple (2, 0).
- Because A3 corresponds to the row at index 2 and column at index 0 in the board.

Hint:

- First, use indexing to extract the number and letter.
- Use int() to cast the number from a string to an int.
- You can use a dictionary to translate the letter into a number.
- Return the result as a tuple: (row, column).


####My Solution 
```
board = [
    ["X", "O", "X"], # 1
    [" ", " ", " "], # 2
    ["O", " ", " "], # 3
]   # A    B    C

def get_row_col(tic_tac):
    tic = tic_tac.upper()
    col = tic[0]
    row = int(tic[1]) - 1

    board_keys = {"A": 0, "B": 1, "C": 2}

    for key in board_keys:
        if key == col:
            column = board_keys[key]
            return (row, column)

print(get_row_col("c1"))
```

#### Another solution 
```
def get_row_col(choice):
    translate = {"A": 0, "B": 1, "C": 2}
    letter = choice[0]
    number = choice[1]
    row = int(number) - 1
    column = translate[letter]
    return (row, column)
```
Things I Was Unprepared For As A Lead Developer
Tags: video
Published: 2021-11-11 16:10:11

[![Things I Was Unprepared For As A Lead Developer](http://img.youtube.com/vi/AwuqJ1qORag/0.jpg)](https://www.youtube.com/watch?v=AwuqJ1qORag "Things I Was Unprepared For As A Lead Developer")
How to use is_sorted function in c++ STL
Published: 2021-11-11 16:01:06

`is_sorted` function of c++ is used to check if the array is already sorted or not.

[Read the full article](https://www.dsabyte.com/posts/blog/The-use-of-is_sorted-in-C-STL-CPP/618d31fb061876aa1363cd1b)
Train PNR Status API
Tags: api, github, javascript, node
Published: 2021-11-11 16:00:35

![PNR Status API](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kkedlzsfha54esy2lucc.png)



So I made a PNR status API using data scrapped from [confirmtkt.com](https://confrimtkt.com)

### General Information

1. Built in Node.js 
2. Express Framework for routes and API handling
3. Cheerio for Data scraping
4. Node fetch to get response from confirmtkt
5. Hosted on [Vercel.com](https://vercel.com)


### Links

***Live Mode*** : [https://pnr-status.vercel.app](https://pnr-status.vercel.app)


**End Point** : ``api/{PNR}``





### Reboot13

[Telegram](https://telegram.me/reboot13_dev) || [Instagram](https://instagram.com/reboot13_dev) || [Twitter](https://twitter.com/reboot13_dev) || [Youtube](https://youtube.com/krutikraut) || [LinkedIN](https://www.linkedin.com/in/reboot13) || [Donate](https://reboot13.hashnode.dev/donate)
Terraform: Prevent default_tags on a specific resource
Tags: terraform, aws
Published: 2021-11-11 15:56:01

---
title: Terraform: Prevent default_tags on a specific resource
published: true
description: Prevent AWS default_tags from being applied to a specific resource
tags: #terraform #aws
//cover_image: https://direct_url_to_image.jpg
---

To avoid having [default_tags](https://learn.hashicorp.com/tutorials/terraform/aws-default-tags) applied to a specific resource in your root module, declare an aliased provider with no defaults set. See the below example:


### Example
```terraform
terraform {
  required_version = ">= 0.15.3"

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "3.55.0"
    }
  }
}

provider "aws" {
  region = "us-east-1"
  default_tags {
    tags = {
      Environment = "Test"
      Service     = "Example"
    }
  }
}

provider "aws" {
  region = "us-east-1"
  alias  = "aws-no-defaults"
}


resource "aws_s3_bucket" "bucket_with_default_tags" {
  bucket = "bucketwithdefaulttags"

}

resource "aws_s3_bucket" "bucket_without_default_tags" {
  bucket   = "bucketwithoutdefaulttags"
  provider = aws.aws-no-defaults
}
``` 

### Receipt

```
$ tf show
# aws_s3_bucket.bucket_with_default_tags:
resource "aws_s3_bucket" "bucket_with_default_tags" {
    acl                         = "private"
    arn                         = "arn:aws:s3:::bucketwithdefaulttags"
    bucket                      = "bucketwithdefaulttags"
    bucket_domain_name          = "bucketwithdefaulttags.s3.amazonaws.com"
    bucket_regional_domain_name = "bucketwithdefaulttags.s3.amazonaws.com"
    force_destroy               = false
    hosted_zone_id              = "<>"
    id                          = "bucketwithdefaulttags"
    region                      = "us-east-1"
    request_payer               = "BucketOwner"
    tags_all                    = {
        "Environment" = "Test"
        "Service"     = "Example"
    }

    versioning {
        enabled    = false
        mfa_delete = false
    }
}

# aws_s3_bucket.bucket_without_default_tags:
resource "aws_s3_bucket" "bucket_without_default_tags" {
    acl                         = "private"
    arn                         = "arn:aws:s3:::bucketwithoutdefaulttags"
    bucket                      = "bucketwithoutdefaulttags"
    bucket_domain_name          = "bucketwithoutdefaulttags.s3.amazonaws.com"
    bucket_regional_domain_name = "bucketwithoutdefaulttags.s3.amazonaws.com"
    force_destroy               = false
    hosted_zone_id              = "<>"
    id                          = "bucketwithoutdefaulttags"
    region                      = "us-east-1"
    request_payer               = "BucketOwner"
    tags_all                    = {}

    versioning {
        enabled    = false
        mfa_delete = false
    }
}
```
Disney+ Day is Tomorrow! Watch Disney Content in AR
Tags: echo3d, augmentedreality, tutorial, unity3d
Published: 2021-11-11 15:47:17

A new way to watch your favorite Disney movies! Use AR! Here’s how you can create a quick Disney-themed AR experience with moving 3D assets and a video using **[echo3D](https://www.echo3d.co/)**. The full demo can also be found on echo3D’s [GitHub](https://github.com/echo3Dco/Unity-echo3D-demo-Disney).

### Register

Don’t have an API key? Make sure to register for FREE at [echo3D](https://console.echo3d.co/#/auth/register).

### Setup
* Clone the [Unity-echo3D-demo-Disney](https://github.com/echo3Dco/Unity-echo3D-demo-Disney).
* Load the scene called “Disney-scene” from the ‘Scenes’ folder
* [Set the API key](https://docs.echo3d.co/unity/using-the-sdk) in the `echoAR.cs` script inside the `echoAR\echoAR.prefab` using the the Inspector.
* [Add the 3D model](https://docs.echo3d.co/quickstart/add-a-3d-model) from the ‘Models’ folder to the console.
* [Add the corresponding metadata](https://docs.echo3d.co/web-console/manage-pages/data-page/how-to-add-data#adding-metadata) listed in the `Metadata` folder.

### Run
* [Build and run the AR application](https://docs.echo3d.co/unity/adding-ar-capabilities#4-build-and-run-the-ar-application).

### Learn more
Refer to our [documentation](https://docs.echo3d.co/unity/) to learn more about how to use Unity and echo3D.

### Support
Feel free to reach out at support@echo3D.co or join our [support channel on Slack](https://go.echo3d.co/join).

### Screenshots


![2.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1636645513155/SDU_PcztO.png)

![3.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1636645516642/pW0Ehx-q_.png)

![4.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1636645511663/8mgYq01iB.png)

![5.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1636645515769/Y84ZQ2cOv.png)

***
> echo3D (www.echo3D.co; Techstars 19’) is a cloud platform for 3D/AR/VR that provides tools and network infrastructure to help developers & companies quickly build and deploy 3D apps, games, and content.

![6.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1636645533752/tdUPnlx-i.png)
Zensar Technologies Assessment question Coding 1 & 2
Tags: java, string, beginners, programming
Published: 2021-11-11 15:45:39

# First
> Given an email address extract username U by eliminating the "@" and subsequent character to form a new string and add length of U at the end of the string to be formed .
Read Sample input output for better understanding.

### Input1:
```
gourav.mk@gmail.com
```
### Output1:
```
gourav.mk9
```
### Input2:
```
hellofrankyji@gmail.com
```
### Output:
```
hellofrankyji13
```
### Solution:
* Paste the sample input in STDIN to check the code 
* To Tinker the code [click here](https://www.jdoodle.com/a/40n1)
```
import java.io.*;
import java.util.*;
public class TestClass {
    public static void Extraction(String Str){
        String sep = "@";
        int pos = Str.lastIndexOf(sep);
        String input = Str.substring(0,pos);
        int len = input.length();
        System.out.print(input+""+len);
    }
    
    public static void main(String args[]) {
   Scanner sc = new Scanner(System.in);
   String Str = sc.nextLine();
   Extraction(Str);
    }
}
```
---------------------------------------------------------------------------------------------

# Second
> Given two integer A and B, write a program to print binary equivalent N of the GCD(greatest common divisor) of A and V and also print the number of 1s in N.
Read the Sample input output to understand better.


### Input1:
```
20 100
```
### Output1:
```
10100
2
```
### Explanation 1:
*will be updated soon *

### Solution:
* Paste the sample input in STDIN to check the code 
* To Tinker the code [click here].(https://www.jdoodle.com/a/40oN)
```
import java.util.*;
public class TestClass {
    static int findgcd(int x, int y){
        int gcd = 1;
        for(int i = 1 ; i<=x && x<=y ; i++){
            if(x%i == 0 && y%i==0){
                gcd = i;
            }
        }
        return gcd;
    }
    public static String binaryString(int n){
        String b="";
        b = Integer.toBinaryString(n);
        
        return b;
    }
    public static int numberOfOnes(String b){
        int count =0;
        for(int i =0; i < b.length();i++){
            if(b.charAt(i)=='1'){
            count++;}
        }
        return count;
    }
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int x= sc.nextInt();
        int y= sc.nextInt();
    String b = binaryString(findgcd(x,y));
    System.out.println(b);
    System.out.print(numberOfOnes(b));
        
    }
}
```
Icon Living
Tags: opensource, seneca
Published: 2021-11-11 15:31:44

My latest open source endeavour has been to work on the updated Seneca College [IPC144 course notes](https://github.com/gusmccallum/IPC144). IPC144 is a class I hold dear to my heart and have fond memories of, for introducing me to C and programming concepts in general. When I took the course back in 2017 I didn't have a laptop yet and would print out reams  of these notes to study at work, so I'm intimately familiar with the notes and their endearingly dated aesthetic. I'm excited to be able to modernize them and help introduce them to the next crop of students who (studying from home I'm assuming) will hopefully have the privilege of viewing them on a computer as God intended, taking full advantage of the technical care myself and the other contributors have put into them. 

The first issue I tackled was [finding better resolution icons](https://github.com/Seneca-ICTOER/IPC144/issues/32) for the site.

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

There were 2 icons present, a 192x192 icon and a 512x512 icon, which were both about as scuffed as the one pictured above (I no longer have the old ones this is just an artistic recreation). I found an image of the Seneca logo online, took the S from that and cleaned it up, creating the 512x512 version to go off of. 

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

I made a 192x192 copy and submitted a [pull request](https://github.com/Seneca-ICTOER/IPC144/pull/53) to get it merged with the main branch. My prof and another student requested some changes (all icon sizes, updated manifest.json and docusaurus.config.js) so I [generated the other icon sizes](https://www.simicart.com/manifest-generator.html/) and [changed the relevant files](https://github.com/Seneca-ICTOER/IPC144/pull/53/commits/660e926429d561c0da20a286a4c46631d0607a48). I requested another review, and my changes were accepted and merged! So ended the first of my IPC144 contributions.

This was a pretty easy PR to complete, all it involved was some quick photoshopping and some changes in a few lines of code. My next line item for the IPC144 notes will be [auditing and fixing](https://github.com/Seneca-ICTOER/IPC144/issues/39) the notes on expressions, which I'm guessing will be a little more involved. More on that to come soon!
Android Jetifier — Can we say Bye-Bye yet
Tags: android, jetifier, androidx, gradle
Published: 2021-11-11 15:30:16

A couple of years ago Google deprecated the support libraries in favor of the new AndroidX library. Jetifier is a tool to do this conversion for you if you are using libraries that still depend on those deprecated support libraries. However, doing this conversion every build might be time consuming and it might not even be needed anymore by this time.

“_But how do I know if it is still useful?_” I hear you ask. Fortunately there is a [Bye Bye Jetifier](https://github.com/dipien/bye-bye-jetifier) Gradle plugin available by [Dipien](https://www.dipien.com) that has the answer!

{% github dipien/bye-bye-jetifier no-readme %}

## Two simple steps to get you started
Luckily it is very easy to get started! Just add the following dependency to your app `build.gradle` file.

```
buildscript {
  dependencies {
    classpath "com.dipien:bye-bye-jetifier:1.2.0"
  }
}
```
_The version at the time of this writing was 1.2.0._

At the end of the same `build.gradle` file, apply the plugin.

```
apply plugin: "com.dipien.byebyejetifier"
```

You’re all set. Now when you run the Gradle command `./gradlew canISayByeByeJetifier -Pandroid.enableJetifier=false` in a terminal, you'll get an output telling you if your project is still depending on Jetifier or not. In my case I still have to do some more maintenance.

![Failing "Bye Bye Jetifier" output example.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b9e64nrrrccf6blsdq9p.png)
_You can not say Bye Bye Jetifier_
Ubuntu 21.10 Released, Steps to Upgrade from Ubuntu 21.04
Tags: ubuntu, linux, productivity, unix
Published: 2021-11-11 15:27:08

As mentioned at the outset, the Ubuntu 21.10 was released on October 14, 2021, with many new features, key changes and update coming with.

## Ubuntu 21.10: New Features

Ubuntu 21.10 or Ubuntu `Impish Indri` is a Debian-based Linux distribution that uses largely free and open-source software. For Internet of Things devices and robots, Ubuntu is available in three editions: Desktop, Server, and Core. All editions can be installed on a single computer or on a virtual machine.

Ubuntu 21.10 - the newest Ubuntu was [released](https://releases.ubuntu.com/21.10/), and contains many features:

* [Gnome 40](https://forty.gnome.org/), contains many features like **touchpad gestures**, many **core apps**.
* [Linux Kernel 5.14](https://www.kernel.org/) with enhanced hardware support and performance improving
* A new desktop installer
* Light Theme now is the default theme

## Software Requirements

| Category | System Requirements                                                    |
| -------- | ---------------------------------------------------------------------- |
| System   | Ubuntu 21.04 Hirsute Hippo                                             |
| Access   | Privileged access to your Linux system as root or via the sudo command |
| Hardware | - 2 GHz dual core processor<br/> - 4 GiB RAM (system memory)<br/> - Hard drive space: 25 GB (8.6 GB as a minimum) (or USB stick, memory card or external drive but see LiveCD for an alternative approach)<br/> - VGA with a screen resolution of 1024x768 pixels<br/> - For the installer media, you'll need a CD/DVD drive or a USB port.<br/> - Internet access is helpful |

## Steps to Upgrade Ubuntu To 21.10 Impish Indri using commands

Read more: [Ubuntu 21.10 Released, Steps to Upgrade from Ubuntu 21.04](https://linuxtus.com/upgrade-to-ubuntu-21-10/)
Debugging a Hot Tub Time (Series) Machine
Tags: cloud, iot, cellular, sms
Published: 2021-11-11 15:21:38

---
title: Debugging a Hot Tub Time (Series) Machine
published: true
description: Notecard and Notehub.io can be used to relay water quality data and send SMS notifications when levels go out of bounds.
tags: cloud, iot, cellular, sms
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q13o9co64ktng7kc7dop.jpg
canonical_url: https://blues.io/blog/debugging-hot-tub-time-series-machine/
---

I don't mean to sound like a prude or anything, but when a neighbor invites me over for a hot tub party, I'm gonna hope the hot tub itself looks a little more like the one on the left, than the one on the right:

![hot tub comparison](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pt9qmmxzd7clyybafmbi.jpg)

You might not know it, but even a clean-looking hot tub or pool can still harbor nasty bacteria! So how can we make hot tubs and pools around the world safer, and frankly, more fun? [In this Hackster project](https://www.hackster.io/rob-lauer/debugging-a-hot-tub-time-series-machine-92e44f), I walk through how I built an IoT project with:

- A variety of **water quality sensors** from DFRobot;
- A **new Feather-compatible microcontroller** (spoiler: [Swan](https://blues.io/products/swan/?utm_source=devto&utm_medium=web&utm_campaign=featured-project&utm_content=hottub));
- A **cellular** device-to-cloud data pump (another spoiler: [Notecard](https://blues.io/products/notecard/?utm_source=devto&utm_medium=web&utm_campaign=featured-project&utm_content=hottub));
- A **cloud-based dashboard** from [Losant](https://www.losant.com/) populated by time series data;
- PLUS an **SMS notification** from [Twilio](https://www.twilio.com/sms) for chlorine emergencies!

*Interested in a preview of this project? Check out the project trailer on YouTube:*

{% youtube pYxxY7sP5MI %}

As an owner (or even user) of a hot tub, **it's a pain to keep your water clean**. You have to maintain the proper chlorine and pH levels by regularly sampling the water, running tests, waiting for the results, adding chlorine, sampling again, and repeating until your levels stabilize appropriately.

This whole process of sampling the water, running tests, waiting for the results, adding chlorine, sampling again, and repeating until your levels stabilize appropriately is dying for automation. The beauty of the IoT too, is that we can take a semi-traditional sensor project and build it out into a robust cloud-based dashboard with proactive SMS text messages for alerting.

![hot tub dashboard and sms](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/av3nleoyj7m9ncolq7i2.png)

**Check out the [completed project on Hackster](https://www.hackster.io/rob-lauer/debugging-a-hot-tub-time-series-machine-92e44f)!**
FLUTTER VS REACT NATIVE: COMPARING TWO MOST POPULAR FRAMEWORKS
Tags: flutter, reactnative, mobile
Published: 2021-11-11 15:19:13

🚩 Mobile apps are an indispensable companion of our daily life. According to some reports, there are 5.19 billion unique smartphone users in the world today. Thus, it is safe to say that near 70% of the world's population use a smartphone in one way or another.

🚩Among all the frameworks created for the development of multi-platform applications, Flutter and RN are the most popular ones. Even though RN has been on the market since 2015, and Flutter is only 3 years old, both frameworks are approximately equally popular and have long been overgrown with a large number of libraries and additional components. 

🚩 So which one? Our CTO Alexander Gerasimov knows everything about it and shares his opinion on both in the article right here 👉 https://codeit.us/blog/flutter-vs-react-native
JQuery Slider Using HTML/CSS
Tags: javascript, webdev, codenewbie, beginners
Published: 2021-11-11 15:13:33

In this slider, we used HTML and CSS, and jQuery. Here we used custom class and id to make a proper slide for every image.

For making responsive we used CSS media queries. Also here we used the jQuery function and prev & next arrows for left/right. Here we do not use any plugins just we used jQuery CDN only.

Make it yours now by using it, downloading it, and please share it.

[Source Code](https://w3hubs.com/jquery-slider-using-html-css/)
btoa replacement in Node.js
Tags: node, btoa, buffer
Published: 2021-11-11 13:57:40

If you're trying to use `btoa` in Node, you'll notice that it is deprecated. It'll suggest you to use the `Buffer` class instead.

Here's how you replicate the same functionality using `Buffer`:
```ts
// Deprecated
btoa(string)

// Buffer equivalent
Buffer.from(string).toString('base64')
```
Simple Blackjack Game in Python Terminal
Tags: python, github
Published: 2021-11-11 14:54:50

Over the past few days, I have been working on implementing a very simple form of Blackjack in python that can be played from the command line. I did this as part of a Codecademy project, and utilized Github to keep my files saved and updated.

Looking back on how I went about it, I probably would have made separate classes for the player and the dealer in order to clean up the code a bit, but I am still happy with how it turned out. If I were to expand on this program, I definitely would need to make those classes so everything stays more organized over time. For now, this incredibly simple Blackjack game works without any bugs. 

The code can be found [here](https://github.com/odrobek/blackjack_python).

Thanks for reading!
Olek Drobek