teleren/devto huggingface dataset:
Introduction to Modern Python
Published: 2022-02-13 20:09:48

Python is a popular programming language with the most simple syntax which enables developers to write smaller lines of code as compared to other programming languages. Python was designed for readability, and has some similarities to the English language with influence from mathematics. It uses new lines to complete a command, as opposed to other programming languages which often use semicolons or parentheses. Also, it relies on indentation, using whitespace, to define scope; such as the scope of loops, functions and classes while other programming languages often use curly-brackets for this purpose.

##  Python syntax
Python syntax can be executed by writing directly in the Command Line or by creating a python file on the server, using the .py file extension which is the run in the command line. 

##  Commenting in python
comments are used to make python code/ program more readable, provide further explanation and also, during testing to prevent execution of certain lines of code. A comment starts with the # symbol.

## Creating Variables in python
Variables are containers for storing data values.
Python has no command for declaring a variable instead it is created after assigning values.
`x = 10
y = "Fridah"
print(x)
print(y)
`
Also, you can get the type of the function by :
`x = 10
y = "Fridah"
print(type(x))
print(type(y))
`
It is important to note that variable names are case-sensitive hence varA cannot overwrite varB
To gain better understanding of python it is adviced to try hands on projects and hence lets create a simple guessing game:
`### GET GUESS
import random

def get_guess():
    return input("what is your guess")

###  GENERATE COM CODE 123
def generate_code():
    
    digits = [str(num) for num in range(10)]

    random.shuffle(digits)
    return digits[:3]

### take user guess and code and compare the no in a loop and create a list of clues according to matching parameters
def generate_clues(code,user_guess):

    if user_guess == code:
        return "code cracked"

    clues = []   

    for ind, num in enumerate(user_guess):
        if num == code[ind]:
            clues.append("match")
        elif num in code:
            clues.append("close")
 
    if clues == []:
        return ["nope"]
    else:
        return clues

print('welcome code breaker!')

secret_code = generate_code()

clue_report =[]

while clue_report != "CODE CRACKED!":
     guess = get_guess()

     clue_report = generate_clues(guess,secret_code)
     print("here is the result of your guess:")
     for clue in clue_report:
         print(clue)
x = get_guess()
print(type(x[0]))`
JavaScript 101: Ultimate JavaScript Guide
Tags: javascript, batichebet, luxacademy, beginners
Published: 2022-02-13 20:00:20

## Introduction to JavaScript
**JavaScript** is a fast, flexible and powerful programming language designed to interact with webpage elements and complex web development
JavaScript has three parts in the web browsers;

- Document Object Model; delivers interface for elements interaction on a webpage.

- Browser Object Model; grants browser API for web browser interaction.

- ECMAScript: offers JavaScript fundamental functionality. 

JavaScript is **Case Sensitive.**

The semi colon **;** is used to terminate JavaScript Statements.

In JavaScript, **console.log ()** is a special object included in the browser for developers to test and debug code in the interactive terminal.

## History of JavaScript

       
>  Ever wondered of “ES6” and “JavaScriptES6” meaning?
![Wondering Gif](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k7qwn4b9wrgd8q9usf4k.gif)

                                        Read on to Find out More

JavaScript was introduced by **NETSCAPE** Communications in **1995** for programmers and web designers.

In 1996, Netscape acquiesced JavaScript to ECMA international to establish the scripting language standards. Thereafter in 1997 ECMA released ECMA-262 initial version of ECMAScript (ES) language.

ECMAScript standards grant rules on the JavaScript features and architecture and ensures consistency between new and previous JavaScript versions.

What is the difference between ECMAScript and JavaScript?
_JavaScript is used in creating applications or programs while ECMAScript outlines the guidelines of developing a new scripting language. ES6 is a sixth edition of ECMAScript._

ES6 is the greatest update on ECMAScript following its 1997 first edition release to aid JavaScript developers. ES6 enables programmers to write   more concise code and save on developer time.

These great features include:

1. Asynchronous action promises
2. Classes creation
3. Arrow functions 
4. Default value parameters
5. _let_ and _const_ Keywords to declare variables.

## Installation of JavaScript Source Code Editor

The JavaScript code editor has syntax indentation, autocomplete, brace matching, debugging and highlighting features. 

The commonly used editors include

- [Visual studio code](https://code.visualstudio.com/download)
- [Notepad ++](https://notepad-plus-plus.org/)
- [Atom](https://atom.io/)
- [Vim](https://www.vim.org/)

## Java Script Hello world Program
      **Using the Console**
Type the “Hello world” in the Console.log ()method.

> console.log(‘Hello World’);
log() is used to print values to the console 

![A Snippet of Hello World code on the browser console](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ew77tetln8ijezdn87py.png)

## JavaScript Fundamentals

- Data types
- Variables
- Methods
- Libraries
- Conditionals(loops)
- Scope 
- Arrays
- Iterators
- Objects
Quantity vs. Quality
Tags: discuss, personal, improvement, growth
Published: 2022-02-13 20:00:12

---
title: Quantity vs. Quality
published: true
description: Quantity vs. Quality
tags: discuss, personal, improvement, growth
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/otkr9fvpfrl78f0cl625.jpg
---

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

> Early in life you should probably strive for quantity (beware of any excess though), and tilt toward quality as you mature.

---

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.
Connecting to a PostgreSQL database in PHP
Tags: php, tutorial, beginners, postgres
Published: 2022-02-13 19:46:18

Connecting to a database is made much easier in PHP using the built in PDO class. PDO is a [database abstraction layer](https://en.wikipedia.org/wiki/Database_abstraction_layer). This allows us to connect to a database, then pass that connection to an object that we can later call. 

To create a PDO object, you must pass in a Data source name, which is really just a string that sets the options for the connection.
Starting with the driver to use, then the host address, the database name, and if you want, a port number.

Important things to keep in mind: 

- set the driver in the DSN to **pgsql** for PostgreSQL.
- your host will be relative to the server it is running on, so **localhost** or **127.0.0.1** means the database is running on the same server the PHP file is being executed on


## PHP Code to connect to a PostgreSQL database.
```
<?php
$databaseName = "";
$username = "";
$password = "";
$dsn = 'pgsql:host=127.0.0.1;dbname=$databaseName';

try {
    //connect to the db
    $db = new PDO($dsn, $username, $password);

} catch (PDOException $e) {
    $error_message = $e->getMessage();
    echo $error_message;
    exit();
}
```
Virtualization Testing
Tags: productivity, help, cybersecurity
Published: 2022-02-13 19:28:45

**Introduction**

Cyber security experts, programming experts, and IT administrators run more than one operating system. Understanding virtualization is the key aspect that enables cyber security and programming experts to perform different technicalities efficiently. Virtualization is running multiple operating systems in a single computer system.

**Types of Virtualization**

**1.Desktop Virtualization**

It occurs when a server can run virtual machines using a hypervisor-enabled software program. This can be installed directly into an operating system such as Mac, Windows, and Linux. 

**2.Server Virtualization**

It is the process of partitioning a single server into multiple servers. The various servers can run in a single separate machines. You can run your programs or business in multi-independent operating systems using a single server.

**3. Network Virtualization**

It is the process of converting a hardware-dependent network into a software-based network. The process allows a physical network to connect to virtual networks. Digital service providers use network virtualization to optimize server resources.

**4. Application Virtualization**

It is an application that allows users to access another computer and use its application. It helps IT administrators to operate multiple computer systems virtually.

**5. Storage Virtualization**

It is the combination of multiple physical storage, making them be single virtual storage. This technology helps save considerable amounts of storage because of additional capabilities.

**Summary**

Virtualization is a technology that anyone in the IT field should embrace because the benefits are immense. The important part is to understand which virtualization suits your daily operations. It is time to utilize modern storage architecture because traditional storage is not sustainable. 

What do you think about virtualization technology? Leave a comment, please.
1&1 Ionos: Modernes WordPress Hosting zum winzig kleinen Preis
Tags: wordpress, hosting
Published: 2022-02-15 11:50:51

---
title: 1&1 Ionos: Modernes WordPress Hosting zum winzig kleinen Preis
published: true
date: 2022-02-13 19:28:40 UTC
tags: WordPress,hosting
canonical_url: https://bloggerpilot.com/ionos/
---

![IONOS WordPress Hosting](https://bloggerpilot.com/wp-content/uploads/2022/02/ionos-desktop.png)

Mir ist Ionos das erste Mal aufgefallen, als ich gemerkt...

Der Original-Artikel erschien auf [1&1 Ionos: Modernes WordPress Hosting zum winzig kleinen Preis](https://bloggerpilot.com/ionos/).

Ich habe ionos in den letzten zwei Monaten benutzt und hier ist meine ionos Bewertung.
1. Preisgestaltung - Wie ich bereits in meiner ionos-Bewertung sagte, ist ionos ein sehr günstiger Hosting-Anbieter. Ich bin seit über 2 Monaten bei ihnen und hatte noch nie Probleme mit meinem Hosting. Der Kundensupport ist großartig und die Support-Tickets werden in kürzester Zeit gelöst (im Durchschnitt 3 Tage). Der Preis beträgt nur $9,95 pro Monat, mit einer kostenlosen Domain, kostenlosen SSL-Zertifikaten und einer kostenlosen php5-Installation.
2. Das Hosting - ionos hat nicht viele Shared Hosting- oder VPS-Optionen. Aber sie haben eine Menge dedizierter Server - sie haben über 20 dedizierte Server in ihrem Rechenzentrum
Convert HTML to Text in Mysql SELECT
Tags: mysql, sql, html, text
Published: 2022-02-13 19:15:09


It is very simple just include your field on this regex expression on your select query:
`SELECT content,REGEXP_REPLACE (content, '<.+?>', '') as new_text_column FROM entity_news en limit 10;`
![Query Example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ypxbqhe6wbvu679f7b37.png)
I really recommend DBever for manage mysql databases. 

https://dbeaver.io/

Good Hacking
How to Build a Whatsapp Bot: Build Whatsapp as a channel for Amazon Connect using Lex
Tags: aws, whatsappbot, bot, devops
Published: 2022-02-13 19:06:12

Recently I have been playing around with whatsapp API to learn some aspects of it. So I thought what better way to learn more about the API than using that in an actual project. So I planned to build a Whatsapp bot which uses Whatsapp API and Amazon Lex, Amazon Connect. This bot enables communication to Amazon connect via a new custom communication channel namely Whatsapp. Basically this will enable someone to communicate to Amazon connect agent simply from whatsapp. I think this will also provide a good learning for someone to use Amazon Lex and Amazon connect APIs. Here I will explain the overall workings of the bot and the deployment approach for various components of the whole bot architecture. This bot involves the below components using which the whole architecture is built:

Whatsapp API (via Twilio API)
- Amazon Lex
- Amazon Connect  

A demo of the bot can be found at below links:

https://www.youtube.com/watch?v=xZoO-9nlnF0&feature=youtu.be 

https://www.youtube.com/watch?v=0MHHr4lnzGo&feature=youtu.be  

More details about this here: https://amlanscloud.com/whatsappbot/
5th week in
Published: 2022-02-13 19:05:07

## Being more involved: 

I've been trying to be more involved in reading up people's work and reviewing PRs. I started out by testing the PR, reading the code and commented any questions I had, as Dave said it's also about spreading knowledge. It was challenging because some PRs can take long to read and understand but I did learn more especially with Duke's PRs regarding Supabase [2844](https://github.com/Seneca-CDOT/telescope/pull/2844) but couldn't leave any advice. Meanwhile, with less intensive PRs, I learned as I go and I actually helped clear around 7 PRs, wow. 

## Fixing Renovate bot not opening PRs: 

I was assigned to fix [Renovate bot not creating PRs](https://github.com/Seneca-CDOT/telescope/issues/2852). At first, I didn't know much about this bot, but I'm used to these situations, I just started reading up on it and the log. It took a while, but eventually I found [this section](https://docs.renovatebot.com/configuration-options/#branchconcurrentlimit) in the Renovate Docs, it says that
> branchConcurrentLimit
Limit to a maximum of x concurrent branches. 0 means no limit, null (default) inherits value from `prConcurrentLimit`.

While the log says 
> DEBUG: Reached branch limit - skipping branch creation(branch="renovate/fontsource-monorepo")

I suspected that there was a branch created by Renovate, and somehow it didn't get merged. And yes, I deleted that branch, Renovate started working again. However, there's still an [issue](https://github.com/Seneca-CDOT/telescope/issues/2725) with this bot, I have an idea how to fix it, will attempt it soon.

## Parser service again 😅:

I've been gradually fixing parser service, it seems like there is some unnecessary code in it because I literally copied from `backend`. It seems like `backend` does expose a few routes in the `web` folder, I need to bring this up to Dave and Josue to understand what is expected from this service (does it expose any routes or does it simply just process feeds?), it affects the tests I'm writing. By the way, I came up with some ideas for e2e tests, I'm gonna finalize my thoughts first before bringing this up to people as well. 

## A list of things I've learnt:
- The differences between `next()` and `done()`
- PostgreSQL: Row level security, seed script, cascade delete
- How JWT is gonna be used in telescope (need to wrap my head around this)
- Dependency-discovery service (how it works)

## What's down the road: 
- Sheriff this week
- Helping Jerry with Dependency-discovery service, he got me interested in this
- Making parser work (it seems like more work than I anticipated)
- Writing tests for parser (in progress)
- Dockerize parser
- Changing parser so that we can work with Supabase
- Twitch integration
Go : Creating a variable which has the name of another variables value
Published: 2022-02-13 18:56:38

Is this possible:
something like 
```go
one := "Hello"
var {substitute the value of 'one' here} = "did it work"
```
I tried:
```go
one := "hewo"
string(one) :=  "but this doesn't work either"
```
Do you know how to do this or if this is even possible?
Cloud Computing - benefícios- parte 1/3
Tags: azure, az900, cloud, microsoft
Published: 2022-02-13 18:44:23

**Quais os principais benefícios da nuvem?**

1. **Alta disponibilidade (High Availability):**  É a capacidade de manter os recursos em execução por um longo período de tempo sem interrupções. Garante o funcionamento dos recursos independente de falhas ou incidentes nos datacenters. Por exemplo, se um datacenter é atingido por algum desastre natural, os recursos passam a rodar automaticamente em outro datacenter mantendo o funcionamento normal das aplicações.

2. **Escalabilidade (Scalability):**  Através da nuvem é possível aumentar ou reduzir os recursos computacionais utilizados de forma simples. Existem 2 formas de gerenciar a capacidade dos recursos.

- Verticalmente (scale up/down): Permite gerenciar a quantidade de memória (RAM) e processamento (CPUs) de uma maquina virtual. 

- Horizontalmente (scale out/in): Permite gerenciar o numero de instâncias  de um recurso,   como a inclusão de maquinas virtuais.
A better copy-mode bind for Tmux
Tags: tmux, cli, todayilearned
Published: 2022-02-13 18:34:07

---
canonical_url: https://waylonwalker.com/til/tmux-copy-mode-binding/
published: true
tags:
- tmux
- cli
- til
series: til
title: A better copy-mode bind for Tmux
---

The default keybinding for copy-mode `<prefix>-[` is one that is just so awkward for me to hit that I end up not using it at all.  I was on a call with my buddy Nic this week and saw him just fluidly jump into
`copy-mode` in an effortless fashion, so I had to ask him for his
keybinding and it just made sense. Enter, that's it.  So I have addedt his to my `~/.tmux.conf` along with one for `alt-enter` and have found myself using it way more so far.

## Setting copy-mode to enter

To do this I just popped open my `~/.tmux.conf` and added the following. Now I can get to `copy-mode` with `<prefix>-Enter` which is `control-b Enter`, or `alt-enter`.

```bash
bind Enter copy-mode bind -n M-Enter copy-mode
```

## More on copy-mode

I have a full video on copy-mode you can find here.


  <div class="onelinelink-wrapper">
      <a class="onelinelink" href="https://waylonwalker.com/tmux-copy-mode/">
          <img style="float: right;" align='right' src="https://images.waylonwalker.com/tmux-copy-mode-og_250x140.png" alt="article cover for 
 tmux copy-mode
"/>
          <div class="right">
              <h2>
 tmux copy-mode
</h2>
              <p class="description">
              https://youtu.be/-ypY_-VmBKk tmux copy-mode is a tmux mode that lets you scroll, search, copy, and jump your way through
              </p>
              <p class="url">
              <span class="read-more">read more</span>  waylonwalker.com
              </p>
          </div>
      </a>
  </div>
Hashing a Password in NodeJs
Tags: security, node
Published: 2022-11-01 06:33:23

---
title: Hashing a Password in NodeJs
published: true
date: 2022-02-13 18:30:00 UTC
tags: Security, NodeJS
canonical_url: https://mojoauth.com/blog/hashing-passwords-in-nodejs/
---

We must not save users’ passwords in the database’s plain text in any application as it poses a severe security threat. We should always save a password in the hashed format. But not all hashing functions are suitable to store passwords. Popular hashing functions like sha1 and md5 are not good for passwords. We will learn how to hash a password in NodeJs using better-suited functions such as Bcrypt, PBKDF2, and Argon2.

<a href="https://mojoauth.com/blog/hashing-passwords-in-nodejs/">Read On</a>
Do you know Javascript ?
Tags: javascript, webdev, beginners
Published: 2022-02-13 18:21:09

We already know that javascript is single threaded, but the way it works is totally different from other programming languages like C and Java. 

## The Event Loop
Javascript has a runtime model, which is based on an event loop. It's responsible for three things: 

- Executing the code. 
- Collecting and Processing Events 
- Executing Queued tasks (actually sub-tasks). 

![JS event Loop diagram](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wyfli3qp8g4aki7thh3l.png)

### Stack

```javascript
function foo(b) {
  let a = 10
  return a + b + 11
}

function bar(x) {
  let y = 3
  return foo(x * y)
}

const baz = bar(7) // assigns 42 to baz
```
In the above example, the order of operation will be in the following manner. 

1. When `bar` is being called, the first frame is created, which was containing references to `bar's` argument and local variables. 
2. When bar calls `foo`, a second frame is created and pushed on top of the first one, containing references to `foo's` arguments and local variables.

### Heap
Objects are allocated in a heap which is just a name to denote a large (mostly unstructured) region of memory.

### Queue
A JavaScript runtime uses a message queue, which is a list of messages to be processed. Each message has an associated function that gets called to handle the message.

At some point during the event loop, the runtime starts handling the messages on the queue, starting with the oldest one. To do so, the message is removed from the queue and its corresponding function is called with the message as an input parameter. As always, calling a function creates a new stack frame for that function's use.

The processing of functions continues until the stack is once again empty. Then, the event loop will process the next message in the queue (if there is one).

### Adding Messages
The function setTimeout is called with 2 arguments: a message to add to the queue, and a time value (optional; defaults to 0). The time value represents the (minimum) delay after which the message will be pushed into the queue. If there is no other message in the queue, and the stack is empty, the message is processed right after the delay. However, if there are messages, the setTimeout message will have to wait for other messages to be processed. For this reason, the second argument indicates a minimum time—not a guaranteed time.

```javascript
const seconds = new Date().getSeconds();

setTimeout(function() {
  // prints out "2", meaning that the callback is not called immediately after 500 milliseconds.
  console.log(`Ran after ${new Date().getSeconds() - seconds} seconds`);
}, 500)

while (true) {
  if (new Date().getSeconds() - seconds >= 2) {
    console.log("Good, looped for 2 seconds")
    break;
  }
}

```

## Final Words
The above article codes are being taken from MDN docs about the event loop
3 Basic Questions on Recursion
Published: 2022-02-13 18:15:59

## Print you Name N times

```
public class N_times {

	public static void printNTimes(int n, String name) {
		if(n==0) {
			return ;
		}
		else {
			System.out.println(name);
			printNTimes(n-1,name);
		}
		
	}
	
	public static void main(String ...args) {
		
		printNTimes(10,"yesh");
		
	}
}
```

## Print 1 TO N in recursion

```
package recursion;

public class Print_N {
	
	
	public static void print_1_to_N(int n) {
		
		if(n==0) {
			return ;
		}
		else {
			
			print_1_to_N(n-1);
			System.out.println(n);
		}
	}
	
	
	
	public static void main(String ... args)
{
		
		print_1_to_N(10);
}
}

```

## Sum of an Array

```

public class Sum_Of_Array {
 public static int sum_Array(int n, int[]arr){
	
	 if(n==-1) {
		 return 0;
	 }
	 else {
		 
		 int sum = sum_Array(n-1,arr);
		 System.out.println(arr[n]+ sum);
		 return arr[n] + sum;
	 }
	 
}
	
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
			
		int arr[] = {1,2,3,4,5,-7};
		System.out.println(sum_Array(5,arr));
	}

}
```