teleren/devto huggingface dataset:
Free pass to KubeCon 2021 and 50%+ cloud savings
Tags: kubecon, aws, googlecloud, kubernetes
Published: 2021-09-14 10:46:46

Get a free pass to KubeCon 2021 and 50%+ cloud savings with CAST AI. We're giving away 10 individual in-person passes and 90 virtual all-access passes! Total prize pool value of $13,750. 

##How to participate

### 1. Sign up for CAST AI
Takes 2 clicks with SSO. You can also login if you have created an account in the past.

### 2. Connect your cluster
Works with both EKS and GKE clusters. We take security seriously and only require read-only access.

You can read more about how it works [here](https://cast.ai/blog/how-does-the-read-only-cast-ai-agent-work-and-what-data-can-it-read/?utm_source=devto).

### 3. View your report
It takes less than a minute for CAST AI to generate an actionable report of your cost savings potential.

**You are eligible as soon as you've received your report.**

You could find more information at [CAST AI](https://get.cast.ai/kubecon-free-pass?utm_source=devto)
Add SSL to Jenkins on CentOS 8
Tags: jenkins, ssl, certbot, centos
Published: 2021-09-14 09:43:35

Run Certbot to create a new certificate and a new private key on the Jenkins Machine and follow the steps inside the command:
```
sudo certbot certonly --standalone
```


Then run the following to extract the JKS (Java Key Store) file:
```
openssl pkcs12 -export -in /etc/letsencrypt/live/<yourdomainname>/fullchain.pem -inkey /etc/letsencrypt/live/<yourdomainname>/privkey.pem -out /var/lib/jenkins/.ssl/certificate.p12 -name "certificate"

keytool -importkeystore -srckeystore certificate.p12 -srcstoretype pkcs12 -destkeystore cert.jks
```

Create a folder inside /var/lib/jenkins and call it ".ssl":
```
mkdir /var/lib/jenkins/.ssl
```

Copy the JKS file into the .ssl folder:
```
cp cert.jks /var/lib/jenkins/.ssl/
```

Change the mode and owner of the JKS file:
```
cd /var/lib/jenkins/
chmod 700 .ssl/cert.jks
chown -R jenkins:jenkins .ssl/
```

Edit the following in the /etc/sysconfig/jenkins file:
```
JENKINS_HTTPS_PORT="8443"
JENKINS_HTTPS_KEYSTORE="/var/lib/jenkins/.ssl/cert.jks"
JENKINS_HTTPS_KEYSTORE_PASSWORD="<your passkey here>"
```


then reroute port 443 to port 8443:

```
firewall-cmd --zone=public --add-service=https
firewall-cmd --add-forward-port=port=443:proto=tcp:toport=8443
firewall-cmd --runtime-to-permanent
firewall-cmd --reload
firewall-cmd --list-all
```
What should I do if HMS Core (APK) cannot be updated (error code 102)?
Tags: huawei, android, hms
Published: 2021-09-14 09:27:48

I integrated the HMS Core SDK via the Maven repository in Android Studio. During the test on a Huawei mobile phone, I was prompted to update HMS Core (APK) to the latest version. But when I tried to update it, error code 102 was displayed, indicating that HMS Core (APK) cannot be updated.

I contacted Huawei technical support personnel (you can also submit a [ticket online](https://developer.huawei.com/consumer/en/support/feedback/#/)), and provided the problem reproducing logs without any filter. They told us that the hmsrootcas.bks certificate, which is required for updating HMS Core (APK), was invalid.
 
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z61dgxep5be9l764yo5f.png) 

Because the project is an Android Studio project, the technical support personnel advised us to delete the hmsrootcas.bks certificate file, build dependencies, and generate the package again according to the [reference documentation](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/integrate-as-sdk-0000001050435953).

Generally, the problem can be solved by performing the preceding steps. However, when I deleted the hmsrootcas.bks certificate file under the Assets file and integrated the SDK again, the problem still occurred no matter how many times I tried.

In response, technical support told us to download the Base SDK integrated for Eclipse to obtain the msrootcas.bks certificate file and add the file to our project. Using Base SDK 5.3.0.301 as an example, the detailed directory for obtaining the file is hmssdk-eclipse-5.3.0.301.zip/security-ssl-1.1.5.306/assets/hmsrootcas.bks.

If you encounter the same problem when you use Eclipse, delete the hmsrootcas.bks certificate file in the package and download the Assets file of the SDK to the project.

SDK download link:
https://developer.huawei.com/consumer/en/doc/development/HMSCore-Library-V5/game-sdk-download-0000001050121222-V5#ZH-CN_TOPIC_0000001050121222__section3142161417195
Array methods that you should know
Tags: javascript, webdev, 100daysofcode
Published: 2021-09-14 08:02:16

## 1- findIndex

The findIndex() method returns the index of the first element in the array that satisfies the provided testing function. Otherwise, it returns -1, indicating that no element passed the test.

```jsx
const array1 = [5, 12, 8, 130, 44];

const isLargeNumber = (element) => element > 13;

console.log(array1.findIndex(isLargeNumber));
// expected output: 3
```

- find() method, which returns the value of an array element, instead of its index.
- Returns The index of the first element in the array that passes the test. Otherwise, -1.

```jsx
// EXAMPLE 1
function isPrime(num) {
  for (let i = 2; num > i; i++) {
    if (num % i == 0) {
      return false;
    }
  }
  return num > 1;
}

console.log([4, 6, 8, 9, 12].findIndex(isPrime)); // -1, not found
console.log([4, 6, 7, 9, 12].findIndex(isPrime)); // 2 (array[2] is 7)
```

```jsx
// EXAMPLE 2
const fruits = ["apple", "banana", "cantaloupe", "blueberries", "grapefruit"];

const index = fruits.findIndex(fruit => fruit === "blueberries");

console.log(index); // 3
console.log(fruits[index]); // blueberries
```

## 2- includes

The includes() method determines whether an array includes a certain value among its entries, returning true or false as appropriate.

```jsx
const array1 = [1, 2, 3];

console.log(array1.includes(2));
// expected output: true

const pets = ['cat', 'dog', 'bat'];

console.log(pets.includes('cat'));
// expected output: true

console.log(pets.includes('at'));
// expected output: false
```

- When comparing strings and characters, includes() is case-sensitive.
- Returns: A Boolean which is true if the value searchElement is found within the array (or the part of the array indicated by the index fromIndex, if specified).

## 3- isArray

The Array.isArray() method determines whether the passed value is an Array.

```jsx
Array.isArray([1, 2, 3]);  // true
Array.isArray({foo: 123}); // false
Array.isArray('foobar');   // false
Array.isArray(undefined);  // false
```

- Returns true if the value is an Array; otherwise, false.

## 4- Some

The some() method tests whether at least one element in the array passes the test implemented by the provided function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array.

```jsx
const array = [1, 2, 3, 4, 5];

// checks whether an element is even
const even = (element) => element % 2 === 0;

console.log(array.some(even));
// expected output: true
```

- Returns true if the callback function returns a truthy value for at least one element in the array. Otherwise, false.

## Links
- [MDN Docs | Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)
Linux commands to compress and decompress files and directories
Tags: linux, tutorial
Published: 2021-09-14 09:25:12

Being an avid linux os user, I often find myself googling how to compress a single file or a directory using bash terminal. The purpose of this article is to compile all those handy commands that I have to copy-paste from internet.


>**Comment if you want more compression related commands that you frequently use**

&nbsp;


## 1A. Compress to tar.gz
```
###### For a file
tar -cvzf <output-file> <input-file>

###### For a folder
tar -cvzf <output-file> <input-folder>
```

*For example:*
```
###### For a file
tar -cvzf file.tar.gz myfile.csv

###### For a folder
tar -cvzf documents.tar.gz Documents
```
&nbsp;


## 1B. Decompress tar.gz
```
tar -xvzf <tar-gz-file>
```

*For example:*
```
tar -xvzf work.tar.gz
```
&nbsp;



## 2A. Compress to .tar
```
###### For a file
tar -cvf <output-file> <input-file>

###### For a folder
tar -cvf <output-file> <input-folder>
```

*For example:*
```
###### For a file
tar -cvf file.tar myfile.csv

###### For a folder
tar -cvf documents.tar Documents
```
&nbsp;



## 2B. Decompress .tar
```
tar -xvf <tar-file>
```

*For example:*
```
tar -xvf work.tar
```
&nbsp;



## 3A. Compress to .gz
```
gzip <filename>

###### To keep the original input file:
gzip -k <filename>
```

*For example:*
```
gzip documents.txt

###### To keep the original input file
gzip -k documents.txt
```
&nbsp;


## 3B. Decompress .gz 
```
gunzip <gz-file>

###### To keep the original compressed file:
gunzip -k <gz-file>
```

*For example:*
```
gunzip filename.gz

###### To keep the original compressed file
gunzip -k filename.gz
```
&nbsp;



## 4A. Compress to .zip
```
###### For a single file
zip <output-zip-file> <input-filename>

###### For multiple files
zip <output-zip-file> <file-1> <file-2> ... <file-n>

###### For multiple files with same extension (.csv, .pdf) 
zip <output-zip-file> *<extension>

###### For a folder
zip -r <output-zip-file> <input-folder-name>

###### For multiple folders
zip -r <output-zip-file> <folder-1> <folder-2> ... <folder-n>
```

*For example:*
```
###### For myfile.txt file
zip document.zip myfile.txt

###### For multiple files
zip files.zip report.docx document.pdf data.txt

###### For multiple files with same extension (.csv, .pdf)
zip pdfs.zip *.pdf
zip textfiles.zip *.txt

###### For Documents folder
zip -r temp.zip Documents

###### For Books and Documents folders
zip -r folders.zip Books Documents
```
&nbsp;


## 4B. Decompress .zip
```
unzip <zip-filename>
```

*For example:*
```
unzip document.zip
```

> In case of error `unzip command not found`, run this:
```
sudo apt-get install unzip
```
&nbsp;
Jenkins nedir ve nasıl kurulur?
Published: 2021-09-14 09:23:11

#1)Jenkins nedir ve nasıl çalışır?

Jenkins yazılım geliştirme süreçlerini otomatize etmemizi sağlayan açık kaynak kodlu olup java ile yazılmıştır. 
Genel anlamda Sürekli Entegrasyon (CI: Continuous Integration) ve Sürekli Teslimat (CD: Continious Delivery) süreçlerini yönetmemizi sağlar.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z0r47qxjc3wtg4k2etos.png)
Jenkins projeyi verdiğimiz adresten çeker, build eder, yapılması gereken testleri yapar ve bu testlerin sonuçlarını raporlar. Ve bu işlem adımlarını sürekli hale getirip yazılım geliştirme sürecimizi otomatize etmiş olur.

#2)Jenkins nasıl kurulur?

**Birinci Adım :** https://www.jenkins.io/download/ bu adresten sistemimize uygun olan Jenkins'i indiriyoruz.
İndirme bittikten sonra http://localhost:8080/ 'e bağlandığımızda Jenkins'in kurulumuna başlayacağımız ekran gelecektir.

**İkinci Adım :** Unlock Jenkins penceresinde yapmanız gereken; Jenkins, belirttiği klasörde (pencerenin ortasındaki kırmızılı alanda) size şifre atamıştır. Belirtilen dosya dizinine gidip verilen admin şifresini alıp gerekli alana yapıştırmanız gerekmektedir. Sonrasında devam et diyip Install suggested plugins'i seçip first admin user penceresine gelmemiz gerekir. Bu alanda ise Jenkins'i kullanacağınız bilgileri girip Jenkins kurulumunu tamamlamış oluyoruz.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oyk494d1c4ytp67ue2ya.png)
Böyle bir ekran karşınıza geliyorsa her şey yolunda demektir. Jenkins'i artık kullanabilirsiniz.
Selenium - Design a Framework: Page Object Pattern
Tags: selenium, java, testing, qa
Published: 2021-09-14 09:05:11

#Which Framework to use? 
## How to write scripts, store objects in a effective way?: 
Frameworks: 
data-driven, keyword-driven & Page Object Pattern
Why POP?
- easy to maintain
- easy readability of scripts
- reduce of eliminate duplicacy
- re-usability of code
- reliability

#Basics of Page Object Pattern 
##PageObjects Class
Create Class for each Page: 
Homepage - all Objects belonging to homepage
Login - JavaClass(LoginPage)
to identify the objects on one page 
```java
public class MaerkischeScholle {

WebDriver driver; 
	//local driver 
	
public MaerkischeScholle(WebDriver driver) {
		 this.driver = driver;
		 //driver from where parameter is passed into constructor, is passed to local driver 
	}  	 
		 		  	
By textFlatAvailability = By.xpath("//*[@id='article-27']"); 

public WebElement TextFlat() {
   return driver.findElement(textFlatAvailability); 
	   }
}
``` 
###Testcase Class
Create a Class for Testcases  
eg. Login
call Login-Field from Loginpage-Class
than you can act on the Login-Field 
or get a Text from a Page and print it 
```java
package testcases;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;

import objectrepository.MaerkischeScholle;

public class CheckAvailability {
	
	@Test
	public void CheckText() {
	
        System.setProperty("webdriver.gecko.driver", "//home//helloworld//Documents//Code//Drivers" + 
    			"//geckodriver");
        WebDriver driver = new FirefoxDriver();
        driver.get("https://www.maerkische-scholle.de");
        
        MaerkischeScholle ms = new MaerkischeScholle(driver); 
        
        String text = ms.TextFlat().getText();
        
        System.out.println(text); 
        
      	}

}
```
###Driver 
The Webdriver is initiated in the Testcase Class 
```java 
 System.setProperty("webdriver.gecko.driver", "//home//helloworld//Documents//Code//Drivers" + 
    			"//geckodriver");
 WebDriver driver = new FirefoxDriver();
```
Testcases Class (parameter for new object of PageObjectClass)
```java
MaerkischeScholle ms = new MaerkischeScholle(driver); 
```
and then passed to the PageObjects-Class as a parameter through the constructor. 
-> PageObjectsclass
```java
WebDriver driver; 
	//local driver 
	
	 public MaerkischeScholle(WebDriver driver) {
		 this.driver = driver;
		 //driver from where parameter is passed into constructor, is passed to local driver 
                PageFactory.initElements(driver, this); 
                 // to use the @FindBy Annotation
	}  	
```

if you switch to another page, just create a new PageObjekt in the Testcases Class and pass the driver
```java
 HomePage hp = new HomePage(driver); 
``` 

###PageObjectFactory @FindBy
```java
@FindBy(xpath= "//*[@id='article-27']")
WebElement textFlatAvailability; 
	  
public WebElement TextFlat() {
   return textFlatAvailability; 
  }
```
questions for HTML table
Published: 2021-09-14 08:59:53

I know this is a silly question but i am making a table based on an existing code. I would like my table headers to be listed on top and separated in to columns with the information down to each column. But what i have now is the info. listed after each row. how do i change my code?![7ACC05A6-6302-4839-9A50-1209D015A608](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tbxo89360nmyz3hwpsaw.jpeg)
How eScooter Mobile App Development is a Great Startup Idea?
Tags: android, javascript
Published: 2021-09-14 08:55:28

How eScooter Mobile App Development is a Great Startup Idea?

The automobile industry is evolving rapidly. With great app ideas like Uber and Lyft, the transportation world has adapted some great digital innovations. Plunging into the same bandwagon, another disruptive trend seen on the verge of expediting is eScooters.

People are finding new means of reducing their commuting time with an economical option. This blog is all about #eScooter app development and its benefits. If you are a #logistics entrepreneur, then do have a good read of this article.

Read more: https://hubpages.com/technology/How-eScooter-Mobile-App-Development-is-a-Great-Startup-Idea

#escooters #logisticsolutions #logisticstechnology #logisticsindustry #logisticssoftware #logisticsautomation #transportation #startup #entrepreneur #technologyinnovation #appdevelopment #escooterapp
Tips for better developer health
Tags: health, webdev, newbie
Published: 2021-09-14 07:29:14

Tips for better developer health

As a web developer, it's a challenge to stay physically and mentally healthy 
Every person is different, so the advice here regarding health is not fit for all.
If you’re having trouble, make sure to consult a physician or mental health professional.

1. Daily Workout?
Do you eat daily?
Do you drink water daily?

You will say, yes these are essential parts of human life.
But when it comes to physical health, many developers skip this thing
Spending 30 min for your body is just as good as eating 3 meals a day
Our body needs proper blood circulation and this exercise is very essential

2. Self Care for Mental Health:
Since a human is not just a body, it is the combination of the physical and mental body
Taking care of mental health is extremely important

Consider starting up a meditation practice.
Meditating can help decrease your stress and anxiety too.

Taking a fifteen-minute break during your workday to meditate can help you recenter, and finish off the day strong.

3. Keep your snacks away from you
Do you want to fill your car with impure petrol?
Obviously not, impure petrol will not only release more smoke and it also makes your car engine less effective

In the same context, please eat good food to keep your human machine with full efficiency.
Eat less but eat healthily
Eat natural, fresh and non-storage food
Eat only to fill your body need, not to fill your tongue need

4. Drink water
While I am writing this newsletter, I have a water bottle on my side.
It is very important to hydrate your body.

While we sit for a long time, we need to keep our body's fluid up to the mark
When you drink water, it just refreshes your mind
When you drink water, you do feel not empty stomach
When you drink water, you are forced to go to the washroom, which forces you to take a break and walk.

That's all for now catch up with me on:
LinkedIn:https://www.linkedin.com/in/yusuf-saifur-rahman-939533192
Twitter: yusuf_software 

Have a great health.
Programmers are not good sales people
Published: 2021-09-14 08:38:09

I think for some odd reason all the sales platforms in the world are being designed by us coders while literally no one is asking the questions should we really let totally inexperienced people create the platforms that carry our world? 
Look at this way, Our shopping experience is actually not what is what suits our life as human beings best, but the realization of some programmers dreams who could not hold on to a simple marriage!!! (Jeff B)
Recursive Coding Anger!!
Published: 2021-09-14 08:31:37

I feel like every time I try to code, I am being buried under an avalanches of errors and unmet dependencies. At first I feel an immense inadequacy in my own abilities but when I go online I see a lot of others in the same state as I am. My feeling transform into an anger directed toward the collective coding community: "Why can you guys not code uniformly? why can you not all use just one framework?"

Then I look at my own code and realize : Damn!!! I am mad at me for being one of those total strangers that can not code clean and correct!!!

Isn't that a recursive angry thought?
audio game development for visually impaired
Tags: python, pygame, lucia, audiogame
Published: 2021-09-14 08:26:59

Hi everyone. This is my first ever post here.
I'm visually impaired born in Pakistan. I love to code. That's why I'm here.
I'm facing a problem, recently I’ve start learning pygame. I was trying to develop a snake game for blind/visually impaired people. by default, it is not accessible, means, if I have created a game window, If I'll print something, it will show on the screen but my screen reader will not read it.
I used a module called, accessible_output2 and created a function to make the screen reader read the output forcefully.
but when I tried to call the function, because the function is in the main loop of the game, it starts looping again and again. and I can’t put it out of the loop, because I want to print my score on the screen, or, when game will be over, I will print, "the game is over". but I could not. I have a question.
is there any better solution to make the games accessible? Someone told me about lucia too, but I don’t know how to use it, there is no any guide available on how to use this library to develop an audio game with lucia. and also, I'm a beginner in coding. but I want to learn.
Design pattern: Singelton
Tags: programming, singelton
Published: 2021-09-14 07:39:16

There are so many types of design patterns to make it easier to solve problems in the program. But this time I only discuss the **Singelton**, so what is the singleton?
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/glbochwli209cvbj1u4t.png)
 

## Apa itu Singelton Patttern ?

The Singleton Pattern is a pattern whose goal is that a class can only be instanced once. Unlike regular classes that don't use **Singelton**, which can create multiple instances.

Why use singleton , why not just use a normal class ?

## Example program
```java
public class Singleton
{
  private static Singleton instance;
	
  private Singleton(){}
	
  public static Singleton GetInstance()
  {
    if(instance==null)
      instance=new Singleton();
		
    return instance;
  }
}
```

## Pros

1. You can be sure that a class has only a single instance.
2. You gain a global access point to that instance.
3. The singleton object is initialized only when it’s requested for the first time.

## Cons
 
1. Violates the Single Responsibility Principle. The pattern solves two problems at the time.
2. The Singleton pattern can mask bad design, for instance, when the components of the program know too much about each other.
3. The pattern requires special treatment in a multi-threaded environment so that multiple threads won’t create a singleton object several times. (using **Multi-Thread — Lazy Load Singleton**)
Web developer roadmap, the only 2 JavaScript array methods you need, web development resources, and more
Tags: webdev, programming, codenewbie, javascript
Published: 2021-09-14 07:27:50

_If you found value in this thread you will most likely enjoy my tweets too so make sure you follow me on [Twitter](https://twitter.com/VladPasca5)  for more information about web development and how to improve as a developer. This article was first published on my [Blog](https://vladpasca.hashnode.dev/)_

You need to check these 5 websites if you use Tailwind:

By Insharamin 
%[https://twitter.com/Insharamin/status/1435190482414432262?s=20]


Focus on learning these 2 JavaScript array methods:

By UbahTheBuilder 
%[https://twitter.com/UbahTheBuilder/status/1434939455228444675?s=20]


Here is how publishing a book can help you:

By CicmilJovan 
%[https://twitter.com/CicmilJovan/status/1435879981498896384?s=20]


Change your mindset:

By DThompsonDev 
%[https://twitter.com/DThompsonDev/status/1436473426848489474?s=20]


The only web dev roadmap you'll ever need:

By WellPaidGeek 
%[https://twitter.com/WellPaidGeek/status/1436426272016637988?s=20]


A cool website that contains a ton of resources for web developers

By Prathkum 
%[https://twitter.com/Prathkum/status/1436091945785323533?s=20]


Don't let those failures define you

By sunilc_ 
%[https://twitter.com/sunilc_/status/1436038004183683073?s=20]

You need to listen to this one:

By oliverjumpertz 
%[https://twitter.com/oliverjumpertz/status/1436333744487555095?s=20]


If you use Youtube to learn web development check this out:

By denicmarko 
%[https://twitter.com/denicmarko/status/1435548481876336641?s=20]

The only eBook you'll need when you're searching for a job:

By EddyVinckk 
%[https://twitter.com/EddyVinckk/status/1435122562237861888?s=20]

_I hope found this useful and if you did please let me know. If you have any questions feel free to DM me on  [Twitter](https://twitter.com/VladPasca5)._