teleren/devto huggingface dataset:
How to provision database using AWS RDS for your next application
Tags: aws, rds, mysql, cloud
Published: 2022-06-28 12:22:06

Amazon Relational Database Service (RDS) is a distributed relational database service by Amazon Web Services. It is a web service running "in the cloud" designed to simplify the setup, operation, and scaling of a relational database for use in applications.

This article will guide you through the simple steps to provision a production grade database for your application within matter of minutes. Lets get started!

- First obvious step is to create AWS account to avail the services.
- Once you have your account ready, Search for RDS on AWS homepage

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

- Scroll bit down and click on "Create Database" button.

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

- Choose "Standard Create" as database creation method & Select MySQL from the Engine options (You can choose database as per your need).

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

- Select MySQL version and template as "Free Tier" 

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

- Move to Settings section and enter details such as your database name in "DB Instance Identifier", username and password.

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

- Leave all other default options and hit on "Create database" at the bottom

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

- Database creation would take up to 10 mins. The status would be changed to available once its provisioned.

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

- Once database is created, you will see database related details such as Endpoint & port, network, security etc.

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

- Your database is not yet available to connect publicly. the Security group needs to have a rule to allow database to be accessed over the internet. Using "Security group rules", add following mentioned inbound rules to your database endpoint.

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

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

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

**You are now ready to test your database connections!**

In this case, Open MySQL Workbench and test the connection using the database Endpoint, port, username and password given at the time of provisioning. _**Yoohooo! It's all ready to be used by your application now!**_

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wlbcylq2o02ir42pht2o.jpg)
Differences between Single and Double Quotes in Bash
Tags: bash, beginners
Published: 2022-06-28 11:57:31

Although for the most part they behave almost exactly the same, single quotes ('') and double quotes ("") are fundamentally different in Bash.

## How different are they?

Well, assume we have the a script hello-world.sh which takes in one positional argument and prints a message to the terminal:

```bash
#!/bin/bash
echo "Hello, $1" # using double quotes
```
Execute
```
hello-world.sh Tiberius
```

Output

```
# => Hello, Tiberius
```

That executes and gives us the expected output. Great!

Now let us have a look at what happens when we instead use single quotes with the same script:

```bash
#!/bin/bash
echo 'Hello, $1' #using single quotes
```

Execute
```
hello-world.sh Tiberius
```

Output

```
# => Hello, $1
```

Well, from the second output above, we see that the result is not what we expected.

## What happened?

When using double quotes, bash will protect all the characters enclosed in the double quotes. That is to say, bash will read them all without giving them any special treatment or meaning. However, when it encounters `$` it will expand the `$` and replace it with the meaning it carries. In our example, this evaluates to the name passed to bash when executing the script.

On the other hand, the single quotes protect everything enclosed including the `$`. Therefore, when executing the script, bash does not expand the `$` to give it the meaning it carries. Rather, it simply prints it out in its literal form. That is why the argument for second script did not evaluate to the value passed.

## What if I want to use the `$` symbol?

If at all we wish to use the `$` symbol, we will have to instruct bash to escape it where appropriate.

Here is an example:

```bash
#!/bin/bash
echo "Hello, $1! Today you earned \$2." #using $ as a symbol
```

Execute
```
hello-world.sh Tiberius
```

Output

```
# => Hello, Tiberius! Today you earned $2.
```

## Key Takeaways

- In bash, single quotes and double quotes behave almost the same but they have different behaviors in certain cases.
- If you want to evaluate the value of a variable in a string, use a double quotes.
- Double quotes allow bash to expand the variable name and replace it with the actual value.
- Using single quotes will not allow bash to evaluate the value of a variable in a string. Rather than, it prints the variable name.
Do you have any idea what tracks Devoxx Morocco covers?
Tags: java, cloud, javascript, eventsinyourcity
Published: 2022-06-28 11:45:49

There are several tracks covered by Devoxx Morocco: 

1. Tools, frameworks & libraries for building native mobile apps, developing for embedded devices, the IoT, Arduino, Raspberry Pi etc.

2. Software architecture, encryption, best practices to develop secure Apps, how-to’s, tools and techniques for developers to drive great architecture.

3. From real-time analysis to massive prediction and cloud storage : Big Data, Fast Data, NoSQL, Machine learning, Deep Learning, Neural Networks, TensorFlow, etc.

4. Progressive web apps, UX/UI, libraries, languages and tools to build web apps.

5. Cloud, containers, modern operational concerns, including build pipelines, orchestration, observability, monitoring, resilience, and compliance, as the software world embraces DevOps and cloud delivery.

6. Software development methodologies, personal development, leadership, working practices, mental health, diversity, inclusion, developer culture, and related subjects.

7. Java Language & Server Side, Java SE, JDK, Modularity, Spring, App Servers, Ruby, Groovy, Scala, Go, Javascript, Clojure, Haskell, Ceylon, etc.

8. Developer candy: Stuff we want to know about but don't (generally) at work, Robotics, biological computing, cybernetics, Entrepreneurship, innovation, tomorrows world.

Who won't like to join such iternational conference with this veriety of tech community resources, you still can apply for the CFP via:https://dvma22.cfp.dev/ or you can also join us at https://devoxx.ma/
[Challenge] Add numbers without (+-*/)
Tags: programming, challenge, beginners
Published: 2022-06-28 11:32:05

Time for another casual little challenge. 

For this one there are only 2 rules:
* you must add numbers `a` and `b` together
* you must NOT use the `+-*/` operators

Apart from that there are no more rules, and can be done with any language you want!

Pseudocode:
```
a = 2
b = 32

add(a, b) => 34
```

Test:
```
add(a, b) == a + b
```
----

Have fun! Let's see what you come up with!
Página principal de coinbase.com maquetada con Bootstrap
Tags: spanish, bootstrap, sass, webpack
Published: 2022-06-28 11:16:05

## Herramientas que he usado

- Bootstrap
- Sass
- Handlebars
- Webpack

### Demo

🔗 URL no disponible temporalmente.


### Repositorio GitHub

🔗 URL no disponible temporalmente.

---

## Versión escritorio

En escritorio, el menú funciona con el hover no con el click, de esta forma le he podido añadir una transición de CSS.

La tabla de rankings que aparece, está maquetada con el componente de [tablas responsive](https://getbootstrap.com/docs/5.2/content/tables/#responsive-tables) de Bootstrap que añade una barra de desplazamiento para poder ver todas sus columnas y no tener que ocultar información relevante.

<br><img src="https://user-images.githubusercontent.com/8589135/175795031-19c123b2-a6a3-4a01-b352-d6626ed7ded6.gif" width="640">

---

## Versión móvil

He utilizado el componente [Offcanvas](https://getbootstrap.com/docs/5.2/components/offcanvas/) de Bootstrap 5, consiguiendo con un solo elemento todas las versiones responsive del menú.

Para animar el icono del menú, he usado los callbacks del componente Offcanvas añadiendo y quitando una clase al mismo.

Usando las clases que añade Bootstrap a los elementos de dropdown, al hacer click en ellos se cambia la dirección del icono.

<br><img src="https://user-images.githubusercontent.com/8589135/176052792-beaa2f7b-fc18-4ea4-95f8-9bddb17ff22f.gif" width="300">
How do I improve as a software developer ?
Tags: beginners, devops, programming, discuss
Published: 2022-06-28 11:02:09

The most common question I get asked.

More often than not the answer is simple:

- Spend more time writing code

- Keep up with the latest trends (YouTube/[Twitter](https://twitter.com/AbderrezakZed)/

[dev.to](https://dev.to/abderrezakzed)) Just as an example.

- Experiment and deep dive into specific tools/ frameworks/languages

- Actually read documentation (before you start coding

and again once you've built something to help solidify

your understanding)

There are no shortcuts in this industry. Time, trends and docs are the simplest things that will elevate your skills and accelerate your career.

Anything that I missed?
How to reject incoming call in xamarin android
Tags: xamarin
Published: 2022-06-28 11:01:37

how to reject incoming call ...? Please suggest me the right way. 
I have the following working code to get the incoming call number. After that, I'm not getting which service to use to end the call.
using Android.App;
using Android.Content;
using Android.Provider;
using Android.Runtime;
using Android.Telecom;
using Android.Telephony;
using Android.Widget;
using Java.Lang;
using Java.Lang.Reflect;
using System;
using Exception = Java.Lang.Exception;

namespace CallManger
{
    [BroadcastReceiver(Enabled = true, Exported = true)]
    [IntentFilter(new[] { TelephonyManager.ActionPhoneStateChanged })]
    public class IncomingCallReceiver : BroadcastReceiver
    {
        public override void OnReceive(Context context, Intent intent)
        {
            if (intent.Action == TelephonyManager.ActionPhoneStateChanged)
            {
                var state = intent.GetStringExtra(TelephonyManager.ExtraState);
                if (state == TelephonyManager.ExtraStateRinging)
                {
                    var number = intent.GetStringExtra(TelephonyManager.ExtraIncomingNumber);
                    
                    //Reject incoming call code should go here
                    
                }
            }
        }
}
}
Deploying a custom Mongodb operator using Helm Charts
Tags: kubernetes, helm, opensource, devops
Published: 2022-06-28 11:00:31

Building a Helm chart and managing it, are two different aspects of packaging an application for Kubernetes. Helm is efficient enough to package a complex K8s application and deploy it. When it comes down to app management, there are certain challenges with Helm. In this short blog, we will see how easy it is to deploy and manage a custom mongodb chart using Devtron.

So, let’s get started

If you are not aware of Helm, please have a read of my previous blog for detailed understanding of Helm charts.
{% link https://dev.to/abhinavd26/all-about-helm-the-k8s-package-manager-2gmj %}

**[Note: The only prerequisite of getting started with Devtron is to have a Kubernetes cluster]**

## Adding Helm repository
Devtron comes with a number of pre-added, commonly used Helm charts that can be seen in the `Charts` section. But if you want to install your custom chart, let's say MongoDB, it can be easily achieved using Devtron.

To add any custom chart, go to `Global Configurations` → `Chart Repository` → `Click on Add Repository` → `Click Save`  → `Click on Refresh Charts`

**[Note: If you do not see any charts in Charts section, click on Refresh Charts to sync all the charts from added repositories]**

![add-repository](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l96klwl0r1lp5w9iiztz.png)

## Deploying Helm charts
Now that we have added our custom chart repository i.e, `percona`, let’s deploy it.

To deploy any chart through Devtron, goto `Charts` → `Click on Chart to Deploy` → `Click Deploy`  → `Change Values as per required` → `Click Deploy Chart`

For instance, I want to deploy Percona's MongoDB operator. Let’s see how we can deploy it with just a few clicks.

**Step-1:** Select the chart to deploy i.e, `percona/psmdb-operator`

![chart-store](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/on0qm5ia0si8kfp4js5i.png)

**Step-2:** Click on Deploy to edit default values as per your requirements.

![edit-default-values](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jbjj2phzwjvj2yq9u0n1.png)

**Step-3:** Edit the default configuration and click on Deploy Chart. You can also see the description for all the parameters, from the sidebar - README of the particular chart.


![chart-values-and-readme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xayvw1qc4c0gjl010ajk.png)

**Step-4:** Congratulations, you have successfully deployed! You can see all the details of your deployed chart such as current status, different workloads, manifests, events, logs, deployment history, etc within Devtron dashboard itself.


![chart-details](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6j3dgk6g92jai8t7k48w.png)

Reach out to us through the [Discord](https://discord.devtron.ai/) channel and refer to [Devtron](https://docs.devtron.ai/hyperion/hyperion) documentation, to find all the features of Devtron.
Why use Java - Map.computeIfAbsent
Tags: java, coding, map
Published: 2022-06-28 10:47:06

---
title: Why use Java - Map.computeIfAbsent
published: true
description: java exploration - short reads
tags: java, coding, map
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
---

### Follow Me, Shout Out, or Give Thanks! 
Please :sparkling_heart: this article. a small thing to keep me motivated =)
Twitter: [@djjasonclark](https://twitter.com/djjasonclark)
Linkedin: [in/clarkngo](https://www.linkedin.com/in/clarkngo/)

# computeIfAbsent
When to use?
- if we want to do call a function if key is not found
- good for initializing a data structure and inserting to map
- a shorter implementation instead of doing on your own

```
default V computeIfAbsent(K key,
                          Function<? super K,? extends V> mappingFunction)
```
[Java docs - computeIfAbsent](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html#computeIfAbsent-K-java.util.function.Function-)

It means, we can **compute** (call) a function, if **key** is absent (not found). 

Scenario: I need a map that have this structure:
```
Map<String, List<String> map;
```

So whenever we want to add a new key and a value, we usually do this:
```
if (map.get("my_key") == null) {
    map.get("my_key").add("new_str");
} else {
    // or Arrays.asList("new_str"),
    map.put("my_key", new ArrayList<>());
    map.get("my_key").add("new_str");
}
```

We can use `computeIfAbsent` to make it elegant:
```
map.computeIfAbsent("my_key", k -> new ArrayList<>());
map.get("my_key").add("new_str");
```
Remaking my first childhood project - a virtual pet fish
Tags: beginners, webdev, javascript, programming
Published: 2022-06-28 10:45:19

When I started learning how to code, my first language was Microsoft QBasic. I was learning on an old IBM 286 that my dad found in storage at the place he worked and I had decided that I was going to make a pet fish. It would swim, it would eat, it would play paper, rock, scissors with me...Basically I wanted a tamagotchi. 

I got to a point where an animation would play of the little ascii fish swimming from left to right and then you would choose what you wanted to do. I learned how to make a little animated slice of bread that would disappear. I learned how to make the fish "randomly" swim up or down as it moved across the screen. And that's as far as I got before the computer completely failed and I lost the whole thing. But that project has always been in the back of my mind.

So I am starting it again. But differently. 

I am going to make it in HTML, CSS and Javascript. It will have the little aquarium animation. It will have the bread eating animation. It will play paper, rock, scissors. But it will do so much more.

I am still working out what I want to do with it in general. I just know that 12 year old me would be really happy to see this project come to completion after losing it so many years ago.

This is basically where I am going to talk through what I have learned, what I am doing, how I am doing it. I want to make a record of the process to give myself the chance to solidify my learning, but also I wanted to be able to show this to other people who might be interested. They say that the best way to learn is to teach, so that's my plan.

}0D
How to solve Group Anagrams problem
Tags: java, coding, algorithms, shortread
Published: 2022-06-28 10:27:23

---
title: How to solve Group Anagrams problem
published: true
description: short reads
tags: java, coding, algorithms, shortread
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
---

### Follow Me, Shout Out, or Give Thanks! 
Please :sparkling_heart: this article. a small thing to keep me motivated =)
Twitter: [@djjasonclark](https://twitter.com/djjasonclark)
Linkedin: [in/clarkngo](https://www.linkedin.com/in/clarkngo/)

An anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.

Let's work with the following:
```
Input: strs = ["eat","tea","tan","ate","nat","bat"]
Output: [["bat"],["nat","tan"],["ate","eat","tea"]]
```

# Trial 1 - Not efficient:
1. (plus space) copy input 

```
["eat","tea","tan","ate","nat","bat"]
```
2. (plus time) sort copied input 

```
["aet", "aet", "ant", "aet", "ant", "abt"]
```

3. (plus space and another space for map/dictionary and plus time) create list and assign same number to same words 
```
[1,1,2,1,2,3]
```

Well... let's just stop there.

# Trial 2 - Hashing:

Hashing? The process of assigning a unique value to an object or attribute using an algorithm, which enables quicker access, is known as hashing. 

1. (plus space and time) iterate over each string and each of its character. in every loop, generate a "hash" by increase value at indices representing character (0 -> 'a', 1 -> 'b')

2. once you have a hash, add that a key to a map/dictionary (key-> string, val-> list of strings). then insert word/s.

When you reach this.. you already know what to do. =)
[Kotlin] How to create CustomView reusable
Published: 2022-06-28 10:13:31

**1. RightClick > UiComponent > Custom View**
There will be 3 new files created `CustomView.kt`, `view_custom.xml`, `attrs_custom_view.xml`(You can delete if you want).

**2. Edit view_custom.xml**
Delete views no need and convert Layout to LinearLayout (vertical or horizontal)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n9mhnyilmm0b8u4rq0lx.png)
 

**3. Edit CustomView.kt**

```
class CustomView: LinearLayout {
    constructor(context: Context?) : super(context)
    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
    constructor(context: Context?, attrs: AttributeSet?, defStyle: Int) : super(context, attrs, defStyle)

    init {
        LayoutInflater.from(context).inflate(R.layout.view_custom, this)
    }
}
```

If you want to get object on layout.

``` CustomView.kt
private val someTextView: TextView by lazy { findViewById(R.id.some_text_view) }
```
How professional programmers help me to do all types of Python programming assignments on time?
Tags: programming, tutorial, python, webdev
Published: 2022-06-28 10:11:18


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dgzwchem23badriosppa.jpg)Our programming gurus understand how to complete any type of Python programming assignment on time. As a result, Python [programming assignment assistance](https://topicwize.com/python-programming-assignment-help/) contains a wide range of python tasks. They are as follows: Python console assignment help, Python GUI assignment assistance, and Flask assignment help. As a result, Python programming tasks are included in Django and data science assignments. Furthermore, Python console-based assignment supports standard input/output. It also includes accepting input and presenting it on the Python terminal. These two are controlled by the Python shell, IDLE, and file input/output. Thus, Topicwize values punctuality in service and the quality of python programming assignments.

Students may be required to create python GUI or desktop-based programmes in order to complete python GUI assignments. After receiving their requirements, our professionals advise the pupils using appropriate tools. Our professionals in flask assignment help can assist you with the proper techniques. Furthermore, Flask is a microframework that does not require any libraries. As a result, Topicwize also offers Django assignment assistance at a low cost. We also provide students with the best data science assignment assistance. In addition, we give you with the greatest resources and tools to help you complete your python assignments on your own. Furthermore, our online support may answer any questions about python programming assignments at any moment. <a href="https://topicwize.com/python-programming-assignment-help/">Know more</a>
在 main.py 中使用 DHT11 感測器會 timeout
Tags: dht11, micropython, esp8266
Published: 2022-06-28 09:57:33

如果你是單純使用 DHT11 感測元件, 而不是使用額外加上電路板的 DHT11 模組, 那麼可能會遇到[這樣的狀況](https://github.com/micropython/micropython/issues/2651), 以底下這個簡單的程式為例：

```python
from machine import Pin
import time
import dht

dht11 = dht.DHT11(Pin(14)) # D5 on D1 mini 

while True:
    dht11.measure()
    print("T:", dht11.temperature())
    time.sleep(3)
```

當一般程式執行時都很正常, 可以讀取感測值：

![](https://i.imgur.com/pDvAiUn.png)

但是如果儲存到控制板上以 main.py 自動執行, 就會在 reset 之後第一次讀取時 timeout：

![](https://i.imgur.com/iftagQT.png)

推測可能是 MicroPython 在控制板 reset 後有些初始動作尚未備妥就執行 main.py, 導致一開始讀取失敗, 只要在程式執行後等待幾秒鐘, 或者是如下加上一個確認的迴圈, 等到能夠正確讀值：

```python
from machine import Pin
import time
import dht

dht11 = dht.DHT11(Pin(14)) # D5 on D1 mini 

dht_ready = False
while not dht_ready:
    dht_ready = True
    try:
        dht11.measure()
        time.sleep(3)
    except:
        dht_ready = False

while True:
    dht11.measure()
    print("T:", dht11.temperature())
    time.sleep(3)
```

這裡使用 `try`/`except` 等待能夠正確讀取感測值, 就可以避開 reset 後一開始無法正常讀取感測值的狀況了：

![](https://i.imgur.com/Ifzc9Lr.png)

補記：如果使用我手邊有加上電路板的 DHT11 模組, 並不會發生這樣的狀況, 查了 [DHT11 的規格書](https://www.mouser.com/datasheet/2/758/DHT11-Technical-Data-Sheet-Translated-Version-1143054.pdf), 建議是在 1-wire 資料腳位加上 5KΩ 上拉電阻, 試過之後也一樣。仔細看了 DHT11 模組的電路板, 也就是多了 2 個 1KΩ 的電阻：

![](https://i.imgur.com/fKGVSLj.png)

看起來一顆當上拉電阻, 另一顆是 LED 的限流電阻, 照著做也沒用, 不知道這個模組實際上還有什麼神奇的地方？