teleren/devto huggingface dataset:
2. Basic String operations
Tags: java, programming
Published: 2022-02-21 07:27:35

**Declaring string and assigning value to it**

```
public class main{
    public static void main(String[] args){
        String str1 = " hello world";
        System.out.println(str1);
    }
}
```
**Concatination of strings**

```
public class main{
    public static void main(String[] args){
        String str1 = " hello world";
        String str2 = "India";
        String str3 = str1+str2;
        System.out.println(str3);
    }
}
```
**Accessing element from its position**

```
public class main{
    public static void main(String[] args){
        String str1 = " hello world";
        //charAt(pos) is used to access element in string at pos position.
        System.out.println(str1.charAt(2));
    }
}
```
**Getting substring from string**

```
public class main{
    public static void main(String[] args){
        String str1 = " hello world";
        //substring get substring from a string by accepting starting and ending position.
        System.out.println(str1.substring(2,4));
    }
}
```
**Using split method**

```
public class main{
    public static void main(String[] args){
        String str1 = "A,B,C,D";
        String str2 = "H I J k";
        //will split string by using , as identifier
        String [] arr1 = str1.split(",");
        // will split string by using space as identifier
        String [] arr2 = str2.split(" ");
    }
}
```
**String inbuilt methods**

```
public class main{
    public static void main(String[] args){
        String str1 = " hello world";
        // will return length of string
        System.out.println(str1.length());
        // will convert all char to uppercase
        System.out.println(str1.toUpperCase());
        //check if string starts with "h"
        System.out.println(str1.startsWith("h"));
        //check if string ends with "h"
        System.out.println(str1.endsWith("h"));
        //will find index of "ll"
        System.out.println(str1.indexOf("ll"));
        // will return index of last occurence if "hello"
        System.out.println(str1.lastIndexOf("hello"));
        //will replace hello with bye
        System.out.println(str1.replace("hello", "bye"));
        System.out.println(str1);
        System.out.println(Integer.toBinaryString(a));
        System.out.println(Integer.toHexString(a));
        System.out.println(Integer.parseInt(Integer.toString(a)));
    }
}
```
Day 3/100, 100 Days of Code
Tags: javascript, beginners, codenewbie, devjournal
Published: 2022-02-21 07:25:05

Today I didn't do too much. I took a quiz that tested my knowledge on the Loops I was studying yesterday. **Do**..**While**.. and **For** loops.

After that I started to learn about High-Order Functions. I'll be working on these tomorrow as well. Still taking the courses via codecademy.
How To Make a Clock in Python With Tkinter.
Tags: python, tkinter
Published: 2022-02-21 07:21:13

```python
#kaveh Sabouri


from tkinter import *
from tkinter.ttk import *
from time import strftime

window = Tk()
window.title('Clock')
window.config(bg="lavender")

def time():
    string = strftime('%H:%M:%S %p')
    lbl.config(text=string)
    lbl.after(1000, time)


lbl = Label(window, font=('Arial', 40, 'bold'),background='lavender',foreground='black')
lbl.pack(anchor='center')
time()

mainloop()


```
ERROR
Disconnected , because no message in 60000 ms - Angular
Tags: karma, test, errors, angular
Published: 2022-02-21 07:08:32

Angular 13. My tests show error: "ERROR
Disconnected , because no message in 60000 ms".

**My Karma.config.js**

module.exports = function(config) {
  config.set({
      basePath: '',
      frameworks: ['jasmine', '@angular-devkit/build-angular'],
      plugins: [
          require('karma-jasmine'),
          require('karma-chrome-launcher'),
          require('karma-jasmine-html-reporter'),
          require('karma-coverage'),
          require('karma-teamcity-reporter'),
          require('@angular-devkit/build-angular/plugins/karma')
      ],
      preprocessors: {
      },
      mime: {
          'text/x-typescript': [
              'ts',
              'tsx'
          ]
      },
      client: {
          jasmine: {
              random: false,
          },
          clearContext: false // leave Jasmine Spec Runner output visible in browser
      },
      coverageReporter: {
          dir: require('path').join(__dirname, 'coverage'),
          // reports: ['html', 'lcovonly', 'text-summary', 'teamcity'],
          subdir: '.',
          reporters: [
              { type: 'html' },
              { type: 'text-summary' }
          ],
          fixWebpackSourcePaths: true,
          'report-config': {
              html: {
                  subdir: 'html'
              },
              lcovonly: {
                  subdir: 'lcov',
                  file: 'lcov.info'
              },
              cobertura: {
                  subdir: 'cobertura',
                  file: 'coverage.xml'
              }
          }
      },
        customLaunchers: {
            ChromeDebugging: {
                base: 'Chrome',
                flags: ['--remote-debugging-port=9333', 'http://localhost:8080/debug.html']
            }
        },
      reporters: ['progress', 'kjhtml'],
      port: 8080,
      colors: true,
      logLevel: config.LOG_WARN,
      autoWatch: true,
      browsers: ['ChromeDebugging'],
      singleRun: true,
      browserNoActivityTimeout: 100000,
      browserDisconnectTimeout: 100000,
      browserDisconnectTolerance: 2

  });
};

Does anyone know what the problem is?
Setting up Multiple Screen Environment in 3 easy steps!!
Tags: developer, programming, computerscience, tutorial
Published: 2022-02-21 07:08:25

In case, you get amazed looking at how people work looking at three screens. Worry not, even if your skillset is reduced to just building static webpages, you can get started with coding on on one system while the other system showing you the results of your code.

Adding to the fact that this trick also work on your mobile phone, which works great if you want to check how the user interface appear on your mobile phone.

![Live Server](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s7iibtenm4yqz8g937vh.png)
##Step 1: Install Live Server on Visual Studio
The magical extension which reflects your changes within a second and is go-to tool for all the web developers. 

Live Server can be downloaded from Extensions in Visual Studio and appears at the bottom right (button named Go Live) of your VSCode once you are done with the installation.

##Step 2: Checking IP Address
In this case, you have to be connected on same Network or else you will have to do few tweaks in the Firewall section. Assuming you are on the same network, visit Command Prompt and type:

```
ipconfig
```
Scroll the the bottom section and jot down the IPv4 address on a text editor

## Step 3:Accomplishing Multiple Environment Setup
Hop onto Browser in a different device and type the IPv4 address in the address bar suffixed with :5500/filename.html.
Portname/Filename Information is supplied with the IP address.

Voila, it is not as complicated as it seem. Works on your alternate system, mobile phone or tablet. Get a cup of Coffee, Put some lo-fi music up and Enjoy Developing. I'm sure that is what heaven sounds like for fellow developers out there.
1.Main Method in java
Tags: java, programming
Published: 2022-02-21 07:05:49

```
public class main{
    public static void main(String[] args)
    {
        //code
    }
}
```
- entry level is main method.

- this method is public so it can be easily found by jvm.

- void because not expected to return anything.

- static so no need to create object of class for execution.

- String[] args are array of string as arguments for code.
Help with a pattern problem.
Tags: java, loops, beginners
Published: 2022-02-21 06:55:41

Hy Devs,
I'm learning Java for the first time. I don't have much programming experience. Can somebody help me with a pattern problem. We have to take an integer n from user and print the following pattern. If n is 4 then pattern will be as shown in code.
I just need some hint here.

```
A
BC
CDE
DEFG
```
[Android Studio] Basic Resource Layout
Published: 2022-02-21 06:37:03

**OverView**
- ConstraintLayout (Constraint(제약조건) 설정만으로 화면 구성)
- LinearLayout
- FrameLayout 


Bias 위치 조절 버튼
Aspect Ratio 가로세로비

**ConstraintLayout**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mcw7anjhqwte5qlokctv.PNG)
① View Options : 제약조건을 화면에 표시하거나 숨길 수 있다.
② Auto Connect : 오토 커넥트가 켜진 상태에서 위젯을 컨스트레인트 레이아웃에 가져다 놓으면 기본 컨스트레인트를 연결해준다.
③ Default Margin : 컨스트레인트 연결 시 설정한 만큼 기본 마진값을 적용한다.
④ Clear Constraints : 화면상의 모든 컨스트레인트를 제거한다. 개별로 제거할 때는 위젯에 마우스 포인터를 올리면 나타나는 동일한 모양의 아이콘을 클릭한다.
⑤ Infer Constraints : 오토 커넥트를 끄고 작업할 때 사용한다. 가까운 위젯이나 레이아웃에 2개 이상의 컨스트레인트를 연결한다.
⑥ Pack : 여러 개의 위젯을 동시에 선택한 상태에서 크기를 조절할 때 사용한다. 선택된 위젯들의 상태에 따라서 크기가 조절될 때도 있고, 위치가 조절될 때도 있다.
⑦ Align : 선택된 위젯들을 정렬해준다.
⑧ GuideLine : layout 안의 모든 위젯에 대해 공통의 여백을 지정할 때 사용한다. 가로 또는 세로 가이드라인을 삽입하면 위젯들은 가이드라인에 컨스트레인트를 연결할 수 있다.
 
  GuideLine
  ConstraintLayout에만 사용할 수 있는 보조 도구다.
GuideLine을 Drag해서 화면 임의의 위치에 가져다 놓으면 layout 안에 배치되는 위젯에 가상의 Anchor Point를 제공한다.
  ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/11isz8t37cz1s26cz23j.PNG)

**LinearLayout**
위젯을 가로 또는 세로로 한 줄로 배치하기 위한 layout.

  orientation 속성
  하위 버전의 android studio에서는 필수 속성이었지만, 3.1부터는 입력하지 않으면 horizontal가 적용돼 가로로 배치된다. (horizontal, vertical만 변경해주면 기존에 배치되어 있던 위젯들도 방향을 바꿀 수 있다.)

  layout_weight 속성
  레이아웃 안에 배치되는 위젯의 크기를 비율로 나타낼 수 있는 옵션. LinearLayout에 배치되는 위젯의 layout_weight 속성은 기본 설정값이 1이다.

  gravity 속성

  layout_gravity 속성
  속해있는 layout(부모 layout)을 기준으로 나의 위치를 설정할 때 사용. 주로 LinearLayout과 FrameLayout 에서 사용된다.

  LinearLayout을 사용하기 위해 ConstraintLayout 안에 LinearLayout을 추가할 수도 있지만 Layout이 중첩되면 그만큼 그래픽 처리 속도가 느려지기 때문에 기본 Layout인 ConstraintLayout을 LinearLayout으로 바꾼 후에 작업을 한다.

  주의사항
LinearLayout과 같은 일반 layout들은 화면 크기(높이, 넓이)를 넘어가는 위젯이 삽입돼도 Scroll이 되지 않는다.
 이럴 때는 최상위 layout을 Scroll 할 수 있는 요소로 감싸야 한다. Scroll View를 사용하려면 ① 기존 layout(ConstraintLayout)을 Scroll View로 변경해서 사용하거나, ② 기본 layout 안에 Scroll View를 추가해야 한다.
 
example)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k910w99zrfqve9wrjzvv.PNG)
1) Change [android.constraintlayout.widget.ConstraintLayout] -> [ScrollView]
2) LinearLayout을 Drag하여 ScrollView 안에 놓는다.
3) 그 다음 LinearLayout 안에 Button을 20개 정도 삽입한 다음 emulator를 실행해보면 scroll 되는 것을 확인할 수 있다.


**FrameLayout **
#37 - Row of the odd triangle - CodeWars Kata (6 kyu)
Tags: javascript, tutorial, 100daysofcode, webdev
Published: 2022-02-21 06:33:58

##Instructions
Given a triangle of consecutive odd numbers:

```
               1
            3     5
         7     9    11
      13    15    17    19 
   21    23    25    27    29
```

---

find the triangle's row knowing its index (the rows are 1-indexed), e.g.:

> odd_row(1)  ==  [1]
> odd_row(2)  ==  [3, 5]
> odd_row(3)  ==  [7, 9, 11]

Note: your code should be optimized to handle big inputs.

---

##My solution:

```javascript
function oddRow(n) {
  let first = 1;
  for(let i = 1; i<n; i++){
    first+=i*2
  }
  
  let r = [first];
  for(let i = 1; i<n; i++){
    r.push(first+=2)
  }
  
  return r
}
```

---

##Explanation
First I got the first value of the row that I'm searching on, I did this by using a for loop that will iterate the number of rows, and in every iteration I changed the value of the var "first" by adding 2 to it and revaluing it.

```javascript
  for(let i = 1; i<n; i++){
    first+=i*2
  }
```

---

After that with that value I made the variable "r" that will contain the result that will be returned, inside of it I stored the first number of the row
```javascript
let r = [first];
```

---

After that I used another loop and inside of it, I pushed every value after the first plus 2, and at the end I just returned "r"

```javascript
for(let i = 1; i<n; i++){
    r.push(first+=2)
  }
  
  return r
```


---

**What do you think about this solution? 👇🤔**

[My Github](https://github.com/Cesardlr)
[My twitter](https://twitter.com/cesar__dlr)
[Solve this Kata](https://www.codewars.com/kata/5d5a7525207a674b71aa25b5)
Var vs Const vs Let what is different ?
Tags: javascript, webdev, beginners
Published: 2022-02-21 06:25:52

**TL;DR** The differences between these three are Scope, Declaration, Update Value and Re-declaration


##Contents
These three are the way to declare variables in Javascript.

Before ES6 in Javascript, You can declare variables by using **var**, But the problem is var scope is **global**, It has a chance to occur **Name collision**.

Const and Let introduce in **ES6**, They come to solve to problem of var because of **Block scope**.

They are used in different scenarios, Const is used when we don't want to change the value of variables and Let we can change the value of variables depending on the event.

I think some of you are a little bit confusing because it has a lot of information, Let me show you the table to compare the differences between these three types of variables declaration. It will be easy to understand and apply to your implementations.


| Declaration Type | Scope | Declaration | Update value | Re-declare |
| --------- |:---------:| -------:| -------:| -------:|
| var | globally, function | Without initialize | Yes | Yes | 
| const | block | Need initialize | No | No |
| let | block | Without initialize | Yes | No |

I will explain what happens above giving a comparison table. First, start from Scope.

###Scope
>Scope determines the accessibility (visibility) of variables. Or the level of accessibility and visibility of variables.

Contains 3 levels
* Block scope
* Function scope
* Global scope

before **ES6** come, They have only Function scope and Global scope.

###Declaration
You need to initialize the value of variables when you declare if you used const, But no need for var and let.

###Update value
If we need to change the value of a variable, We need to use var or let only.

###Tips
You have noticed each declaration has something different, You need to consider by a situation when to use var, const, or let. My suggestion is to use const or let for reduced the scope problem especially global scope from var, It will make a **Name collision**.

If something's wrong, incomplete or you want to share the experience. Please let me know in the comment.
Thank you for taking the time to read this😘.
Get Your Best Data Science Certification - QuickStart
Tags: datasciencecertification, cybersecuritybootcamponline
Published: 2022-02-21 06:13:24

Are you looking to advance your career as a data scientist? Earning one of these [**best data science certification**](https://www.quickstart.com/bootcamp/data-science-and-analyst/) can help you stand out in one of the most in-demand IT fields. They're also a technique for recruiters and hiring managers to verify your abilities so they know what they're getting if they hire you. For more info, contact us at QuickStart!
Privileged
Tags: discuss, personal, improvement, growth
Published: 2022-02-21 06:12:22

---
title: Privileged
published: true
description: Just be grateful for what you've got
tags: discuss, personal, improvement, growth
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2tnt76b2lk0xo6nfuvxw.jpeg
---

_Originally published on [my blog](https://www.nikola-breznjak.com/blog/daily-thoughts/privileged/)._

> All of us that were privileged/lucky/pick_your_word to be born in favorable conditions (country, family, time in history, etc.), we should be grateful and reciprocate.

---

This is [why I write](https://www.nikola-breznjak.com/blog/daily-thoughts/why-do-i-write-these-daily-thoughts-posts/) these 'daily thoughts' posts.
The trade of tomorrow
Tags: discuss, personal, improvement, growth
Published: 2022-02-21 06:05:07

---
title: The trade of tomorrow
published: true
description: In the future, we'll need people that teach us how to be happy
tags: discuss, personal, improvement, growth
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1k17dwtn1awd9wg2hjew.jpg
---

_Originally published on [my blog](https://www.nikola-breznjak.com/blog/daily-thoughts/the-trade-of-tomorrow/)._

> In the future, we'll need people that teach us how to be happy. Come to think about it, that future may already be here.

---

This is [why I write](https://www.nikola-breznjak.com/blog/daily-thoughts/why-do-i-write-these-daily-thoughts-posts/) these 'daily thoughts' posts.
Open Speech Corpus - Self Hosted and Open Source Tool to Collect and Validate Voice Samples.
Tags: javascript, firebase, react, opensource
Published: 2022-02-21 06:04:43

If you are working on a small speech recognition project or app, collecting and validating voice samples can be difficult, the easiest way to do this is using the Open Speech Corpus tool, which is an open-source and self-hosted tool built using Firebase and ReactJS.

The tool and its installation steps are available on Github.

**Open Speech Corpus** is a voice sample collection and validation tool that helps you to collect and validate voice samples through Crowdsourcing. The Tool can be easily used by anyone who wants to collect voice samples, the developer needs to fork the repository and change the settings to your needs.

[Github Repo. Link](https://github.com/open-speech-corpus/open-speech-corpus-tool)

Features:

**1. Clean User Interface**

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

**2. Collect Recordings**

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

**3. Collect Feedback of Recordings**

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

**4. Dedicated Admin Panel for analysis and management.**

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

[Github Repo. Link](https://github.com/open-speech-corpus/open-speech-corpus-tool)
JAVASCRIPT SPREAD OPERATOR
Tags: javascript, tutorial, react, webdev
Published: 2022-02-21 05:59:37

Hi everyone, I am here again with tips on how to write easy simple and clean code.

Going forward I will state an example on how to practice the use of **Spread Operator**


Look at the code snippet below (using objects & arrays to shallow and copy)

```javascript
const newObject = {};
Object.keys(oldObject).forEach((key) => {
    newObject[key] = oldObject[key];
});


const newArray =[];
oldArray.forEach((element) => {
   newArray.push(element);
});
```

You can easily re-write that code in a much more simple way. Life will be much more easier for anyone reading your code. 


```javascript
const newObject = { ...oldOject };
const newArray =[ ...oldArray ];
```

Thanks for reading and happy coding.
*SAM SONTER*
Var vs Const vs Let มันต่างกันยังไงนะ ?
Tags: javascript, webdev, beginners
Published: 2022-02-21 05:40:35



**TL;DR** ความแตกต่างของทั้งสามตัวนี้คือ Scope, Declaration, Update แล้วก็ Re-declaration นั้นเอง



##เนื้อหา
หลายคนเคยสงสัยไหมว่า เจ้า  var, const, let นั้นมันต่างกันยังไงทั้งๆที่จริงแล้วทั้งสามอย่างที่กล่าวมาสามารถใช้ประกาศตัวแปรได้ทั้งนั้น 


จริงๆแล้วมันมีที่มาเป็นอย่างงี้ครับ คือในช่วงแรกของ **Javascript** นั้นการประกาศตัวแปรจะมีแค่ **var** เท่านั้นแล้ว scope มันเป็น global ทำให้การ implement อะไรต่างๆค่อนข้างที่จำสับสนว่า ตัวแปรที่เรียกใช้นั้นเป็นของ file ที่เรากำลัง implement หรือเป็น file  อื่นนั้นเอง 

ทำให้ในยุคของ **ES6** ได้เพิ่มการประกาศตัวแปรเพิ่มอีก 2 ชนิด คือ **const กับ let** เจ้าสองตัวนี้เข้าช่วยให้การ development ง่ายขึ้นเพราะ block scope ของทั้งสองตัวนี้เป็น **local** นั้นเอง แถมการเรียกใช้ก็แบ่งแยกชัดเจน const ใช้สำหรับตัวแปรที่หลังจากที่ initialize ค่าให้แล้วไม่อยากเปลี่ยนแปลงค่าของมันอีก ซึ่งแตกต่างกับ let ที่ เราอยากให้ค่ามันสามารถเปลี่ยนไปได้เรื่อยๆตาม usecase ที่เกิด 

คราวนี้หลายๆคนเริ่มสับสนแล้วว่าเราควรที่จะใช้การประกาศตัวแปรแบบไหนดี เดี๋ยวผมจะเอาตารางเปรียบเทียบมาให้ดูนะครับเพิ่อที่จะให้ง่ายต่อการนำไปใช้


| Declaration Type | Scope | Declaration | Update value | Re-declare |
| --------- |:---------:| -------:| -------:| -------:|
| var | globally, function | Without initialize | Yes | Yes | 
| const | block | Need initialize | No | No |
| let | block | Without initialize | Yes | No |

ผมจะอธิบายตารางด้านบนให้นะครับเริิ่มจาก **Scope** ก่อน

###Scope
>Scope determines the accessibility (visibility) of variables. หรือก็คือการเข้าถึงของตัวแปรนั้นๆ ว่าสามารถเข้าถึงได้ระดับไหนนั้นเอง

จะประกอบไปด้วย 3 ระดับ
* Block scope
* Function scope
* Global scope

ซึ่งเมื่อก่อน **ES6** จะมามันมีแค่ Function scope กับ Global scope เท่านั้น 

###Declaration
การกำหนดค่าตัวแปรขณะที่ประกาศตัวแปร อย่าง var กับ let ไม่จำเป็นที่จะต้องกำหนดค่าตัวแปรตอนประกาศก็ได้ แต่ว่า const นั้นจำเป็นที่จะต้องกำหนดต่าตัวแปรให้มัน

###Update value
ถ้าหากเราอยากเปลี่ยนค่าของตัวแปร เราสามารถใช้ var หรือ let เท่านั้น

###Tips
จะสังเกตุได้ว่าแต่ละการประกาศตัวแปรจะมีบางอย่างที่แตกต่างกันขึ้นอยู่กับสถานการ์ที่เราจะนำไปใช้ แต่โดนส่วนตัวแล้วผมอยากแนะนำว่าใช้ const กับ let ดีกว่าเพื่อที่จะหมดปัญหาเรื่อง scope ที่บางทีชื่อตัวแปรของเราอาจจะซ้ำกันได้ทั้งใน file หรือ file อื่นๆ

สามารถพูดคุยกันได้นะครับ บางอย่างผมอาจจะพูดไม่เคลียร์, ไม่เข้าใจ หรืออาจจะผิดพลาดตรงไหนก็ขอโทษด้วยนะครับผม หรืออยากจะเสริมเนื้อหาตรงจุดไหนแชร์มาได้เลยนะครับอยากแลกเปลี่ยนประสบกาณ์กับเพื่อนๆ แล้วเจอกันใหม่ในโพสต์หน้าครับ
Can I Develop Web Apps Using Flutter
Published: 2022-02-21 05:02:20

Yes. Flutter is a mobile app SDK that enables developers to build high-quality mobile apps on Android and iOS platforms. But it also includes built-in support for rendering web views, so you can use Flutter to create web apps that look and feel like native apps.

As flutter can be used to develop web apps it is important to understand whether it’s actually feasible?

Flutter has a number of advantages over traditional web development frameworks. For starters, it uses a compile-time code generation strategy, which means that your app's user interface will be rebuilt every time you make a change.

Also, Flutter offers powerful animation capabilities that let you create smooth, fluid animations with very little effort from the developer.

You can hire Dedicated Flutter developers from **WebClues Infotech**. Hire Flutter developers to develop intuitive, visually appealing, user-friendly, and scalable mobile applications. Our Flutter programmers have in-depth knowledge of Flutter SQLite and extensive experience of working with SOLID principles & Restful API. Access 40+ dedicated Flutter app developers who have a strong understanding of Flutter's layered architecture to build advanced Flutter apps.

Contact now!