teleren/devto huggingface dataset:
Best DevOps Course
Published: 2022-10-05 17:52:52

They are dominating the idea of instruments like GIT, Jenkins, Sonar, Nexus, Ansible, Docker, Terraform, Gafana, and so forth with DevOps preparation. all day, every day Lifetime Backing. Adaptable Bunch Timings. The IgmGuru's DevOps Internet Preparing program is planned under the most current educational plan from the area master Masters. This cutting-edge preparation for DevOps will give you a top to bottom information on the most requested DevOps apparatuses like GIT, Jenkins, Sonar, Nexus, Ansible, Docker, Terraform, Promethesus, Gafana andmany more. DevOps preparing content is adjusted so members will have incredible openness to the most recent DevOps instruments with continuous activities. IgmGuru is extremely playful about the [DevOps Course Online](https://www.igmguru.com/cloud-computing/devops-certification-training/) as this prepares students industry.
Algorithms and Data Structures - P - 1.0
Tags: dsa, computerscience, algorithms, programming
Published: 2022-10-05 17:50:31

In this blog, you'll get to know

**1. What are algorithms and data structures**
**2. Why algorithms**
**3. Example algorithms**
**4. How we benefit by learning these algorithms** 


## What are algorithms and data structures
An algorithm could be defined as a computational step or a sequence of computational steps that transforms the input into the desired output. A data structure is a way of storing and organising data.


## Why algorithms and data structures
Imagine a farmer and his mango-growing skills

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

**Algorithm** ====> **Skill to grow mango trees**
**Input Data** ====> **Mango seeds**
**Output Data** ====> **Ripe Tasty Mangoes**

A farmer uses his mango growing skills(algorithm) to transform mango seeds(input data) into ripe mangoes(desired output), similarly, all the available algorithms help us to process the data and transform/derive the output from it. 

## Example algorithms

1. Insertion sort        : Used to sort an array
2. Breadth-first search  : Used to search an element 
3. Lempel–Ziv–Welch (LZW): Used to compress data
  
These are some sample algorithms, from compressing files inside a pen drive to transferring data over the internet everything is governed by algorithms and knowledge of these algorithms helps us design efficient systems. 

## How we benefit by learning these algorithms
Let's take up an example and understand how a beautiful sorting algorithm speeds up the process of sorting a set of inputs mathematically.

####Insertion Sort
For n number of elements in an array, the time taken by insertion sort is 
**c1*n^2**      ------------------- (1)
c1 ---> Independent constant that does not depend on n
n  ---> Number of elements

####Merge Sort 
For n number of elements in an array, the time taken by merge sort is 
**c2*n*ln(n)**   ------------------- (2)
ln(n) ---> log(n) to the base 2
c2    ---> Independent constant that does not depend on n
n     ---> Number of elements

#### Let's Compare their performance
There are two computers **A**(imagine A is faster than B) and **B**(imagine B is slower than A)
**A** --> Processes **10^10** instructions/second 
**B** --> Processes **10^7** instructions/second
**c1**--> **2**
**c2**--> **50**
**n** --> **10^7**

By applying the above data : 
Computer A takes
**(2*(10^7)^2)/(10^10) = 5.5 hrs(approx)**

Computer B takes
**(50*(10^7)*ln(10^7))/(10^7) = less than 20 mins(approx)**

Even though **computer B is slower than computer A**, with an efficient algorithm like **merge sort** and for large data like 10 million records **computer B is able to sort faster compared to computer A**(NOTE: this holds good for large values of n like 10 million)

We could infer from the above observation that by having good knowledge of algorithms we would be able to efficiently use our resources like CPU, Memory(RAM).
Ruby Folder Syntax Examples
Published: 2022-10-05 17:33:57

app > config > routes:

```
  get("/rock",{:controller => "application", :action => "play_rock"})

  get("/paper",{:controller => "application", :action => "play_paper"})

  get("/scissors",{:controller => "application", :action => "play_scissors"})
```
app > controllers > applications_controller.rb

```
class ApplicationController < ActionController::Base
  layout(false)

  # Add your actions below this line
  # ================================
  
  def play_rock
  
    index = rand(3) 
    moves = ["rock", "paper", "scissors"] 
    @comp_move = moves.at(index)
  
    if @comp_move == "rock" 
      @outcome = "tied" 
    elsif @comp_move == "paper"
      @outcome = "lost"
    elsif @comp_move == "scissors" 
      @outcome = "won" 
    end
    
    render({:template => "game_templates/rock.html.erb"})
  end

  def play_paper

    index = rand(3)
    moves = ["rock", "paper", "scissors"]
    @comp_choice = moves.at(index)

    if @comp_choice == "rock"
      @outcome = "won"
    elsif @comp_choice == "paper"
      @outcome = "tied"
    elsif @comp_choice == "scissors"
      @outcome = "lost"
    end

    render({:template => "game_templates/paper.html.erb"})
  end

  def play_scissors

    index = rand(3)
    moves = ["rock", "paper", "scissors"]
    @comp_option = moves.at(index)

    if @comp_option == "rock"
      @outcome = "lost"
    elsif @comp_option == "paper"
      @outcome = "won"
    elsif @comp_option == "scissors"
      @outcome = "tied"
    end

    render({:template => "game_templates/scissors.html.erb"})
  end

end
```

app > views > (created from here on out) 
game templates > 
(rock or paper or scissors).html.erb

```
<h2>We played (rock/paper/scissors)!</h2>

<h2>They played <%= @comp_choice %>! </h2>

<h2>We <%= @outcome %>! </h2>

```
Reverse Only Letters
Tags: javascript, leetcode
Published: 2022-10-05 17:28:07

Given a string s, reverse the string according to the following rules:

All the characters that are not English letters remain in the same position.
All the English letters (lowercase or uppercase) should be reversed.
Return s after reversing it.

Example 1:

Input: s = "ab-cd"
Output: "dc-ba"
Example 2:

Input: s = "a-bC-dEf-ghIj"
Output: "j-Ih-gfE-dCba"
Example 3:

Input: s = "Test1ng-Leet=code-Q!"
Output: "Qedo1ct-eeLg=ntse-T!"

```js
var reverseOnlyLetters = function (arr) {
  let str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  let start = 0;
  let end = arr.length - 1;
  let s = arr.split("");

  while (start < end) {
    let charStart = s[start];
    let charEnd = s[end];

    if (str.includes(charStart) && str.includes(charEnd)) {
      s = swapChars(s, start, end);
      start++;
      end--;
    }

    if (!str.includes(charStart)) {
      start++;
    }
    if (!str.includes(charEnd)) {
      end--;
    }
  }
  return s.join("");
};

const swapChars = (s, start, end) => {
  let firstChar = s[start];
  let enChar = s[end];
  s[start] = enChar;
  s[end] = firstChar;
  return s;
};

console.log(reverseOnlyLetters("ab-cd"));
// Output: "dc-ba"

console.log(reverseOnlyLetters("a-bC-dEf-ghIj"));
// Output: "j-Ih-gfE-dCba"

console.log(reverseOnlyLetters("Test1ng-Leet=code-Q!"));
// Output: "Qedo1ct-eeLg=ntse-T!"

```
Deploying Multiple NodeJS Servers on a Single DigitalOcean Droplet; Managed by PM2, Without Using an ecosystem.config.js file
Tags: pm2, node, servers, env
Published: 2022-10-05 17:17:26

Firtly, my servers are nginx-based and certified by certbot - let's encrypt. Hence, I'm assuming you're acquainted with this setup. Now, unto the epicenter of our problem.
A major problem using the prescribed (best-practise) procedure for deploying several NodeJS server instances on digitalOcean (referred to as DO hereafter), is that; environment variables become difficult to locate; once the server is started. This becomes a bigger trouble when there are more than one servers, to be used on a single droplet. I circumvented through this challenge, by                                                   doing the following;
```
a) Create various folders, on DO named w.r.t how you'd like PM2 to identify these servers; i.e. if you've got 3 servers to deploy on a single droplet, you'd say;
e.g plutonium_server, neptunium_server, promethium_server

b) clone your repo into each folder: git clone https://github.com...

c) cd into the repo; sudo nano package.json

d) in your start script, enter: "pm2 start <your start file>"
e.g: "pm2 start ./backend/dist/index.js"

ensure your package.json file has got an engines object; (recommended for deployment)
e.g engines: {
                "node": "18.1.0",
                "yarn": "1.22.18"
             }

e) save the file by saying; 
ctrl + x then shift + y then enter

f) install your project dependencies; yarn install

g) copy your environment variables; create the environment variable file as you have it locally 
e.g: cd backend/src/config && sudo nano .env

h) copy and paste the contents of the local env-file into the newly server .env file you can call the env file whatever 

name you perceive; but as programmed locally. Just ensure the extension is appended. Repeat step e.

i) spin the server: yarn start

j) rename the server: pm2 restart 0 --name plutonium_server

k) you can now run pm2 logs or pm2 list for monitoring

l) subsequently, all you need do next time is: pm2 start plutonium_server, pm2 stop plutonium_server etc

m) replicate this procedure; to deploy other instances.
```

Thanks for reading.
ftp_ssl_connect with explicit ftp over tls
Published: 2022-10-05 17:13:22

/ftp_ssl_connect with Explicit ftp over tls
$ftp_host = 'xxx.xxx.xxx.xxx'; /* host */
$conn_id = ftp_ssl_connect($ftp_host,9906);
ftp_pasv($conn_id, TRUE);
var_dump($conn_id);
Result: bool(false)

There are some firewall restrictions on the host and probably required white list on the host. Do I have to whitelist the client system/server or the system where I am interacting with the client system/server? Suggestions/Solutions would be greatly appreciated.
Update on RP2 (10/22): Open-source Crypto Tax Suite
Published: 2022-10-05 17:09:33

RP2 and DaLI are the components of a powerful, privacy-focused, open-source, free, non-commercial crypto tax suite (available on Github):

* RP2 is the tax calculator: https://github.com/eprbell/rp2
* DaLI is the data loader: https://github.com/eprbell/dali-rp2

For a general introduction to RP2 and DaLI [read this article](https://dev.to/eprbell/rp2-open-source-crypto-tax-software-f20). The rest of this article describes what has changed since last tax season.

Since last April RP2 and DaLI underwent a lot of development and gained significant traction in terms of Github stars, PRs, issues and discussions. Here are some of the main updates.

RP2:

* added HIFO support (FIFO and LIFO were already supported)
* new open positions report, showing unrealized gains / losses and more
* improved accounting method plugin infrastructure: it's now very easy to add new methods
* reworked documentation
* many more fixes and improvements: see [CHANGELOG](https://github.com/eprbell/rp2/blob/main/CHANGELOG.md) for full details

DaLI:

* added several new data loader plugins
* new pair conversion infrastructure with price routing
* added top-level multithreading, which improves performance when reading data from multiple exchanges/wallets
* reworked documentation
* many more fixes and improvements: see [CHANGELOG](https://github.com/eprbell/dali-rp2/blob/main/CHANGELOG.md) for full details

RP2 and DaLI are a community-driven effort: they feature a powerful programmable plugin architecture that can be used to expand their functionality via Github PRs.

Other notable features:

* no transaction limits, no premium versions, no payment requests, no personal data sent to a server (at risk of being hacked), no account creation, no unauditable source code
* [transparent computation](https://github.com/eprbell/rp2/blob/main/docs/output_files.md#transparent-computation-rp2-full-report-output): RP2 generates full computation details for every lot fraction, so that it's possible to verify step-by-step how RP2 reaches the final result.
My Experience: Completing Flatiron School Software Engineering (Live) Bootcamp
Tags: react, javascript, rails, ruby
Published: 2022-10-05 17:06:24

## The Stack (& core concepts)

1. **JavaScript** (HTML + CSS, JSON Server, Request/Response Cycle)
2. **React** (React Router, Single Page Applications, Dynamic Re-rendering)
3. **Ruby** (OOP, ORMs, SQL, RESTful APIs)
4. **Ruby on Rails** (RESTful APIs /w framework)

## The Cost:
- Roughly $17,000

## The Timeline:
- 5 Phases, each 3 weeks long
- JavaScript/HTML/CSS -> React as a frontend framework -> Ruby/OOP/SQL essentials -> Rails as a backend framework
- Phases 1 - 4 you work on and present group projects
- Phase 5 a 3 week long solo project
- 15 weeks total duration + prework

## Phase Structure:
1. Roughly 1 week of learning a new concept (i.e. React)
2. Roughly 1 week of preparing for a code challenge (i.e. React exam)
3. Roughly 1 week of applying concepts to your phase project

## Pros:
- Challenging. This is not something you can easily skim through. If you want something more lax that you can do at your own pace & learn at more of a dilettante-ish rate this is not that.
- Applicable content
- Namebrand bootcamp, higher quality than most
- Full stack program

## Neutral:
- A pro or a con but you are 100% responsible for your own strength leaving the bootcamp. The staff is here to help but ultimately it's on you what you get out of this.

## Cons:
- A little bit of a sink or swim environment. If you set your mind to this you can do it. However it will require a lot of effort and self-reassuring along the way and there is no 2 ways about it. Especially if you are entirely new to technology.
- Expensive
- Rails is not as popular as it once was
- There is some self-guided material provided but CSS content is totally lacking
- Data structures & Algorithms (DSA) is treated as an after thought. There is self-guided material but realistically, very little time to do it if you want to complete all the core material with comprehension.

## Recommendation?:
Yes. If you can commit to the fulltime (online or in person does not matter) program.

## The Outcome:
Pending, stay tuned for more.
An Experiment With Dynamic Loading
Tags: javascript, devjournal
Published: 2022-10-05 17:03:09

I've been thinking about how to hot reload within server code to improve my development experience a lot lately. One thing that doesn't appeal to me much is using something like webpack and its HMR implementation, primarily because it has a lot of tricky implementation details when handling things like reconnecting databases, etc.

One idea I had the other day was to simply try out using a `Worker` within node to handle the reloading. Workers run in their own interpreter, so they should work!

Here's the quick test I wrote up to in fact confirm that using `Worker` is feasible for dynamic loading:

```javascript
// index.js
const { Worker } = require("node:worker_threads");

const t = setInterval(() => {
  new Worker("./worker.js");
}, 1000);
```

```javascript
// worker.js
console.log("WORKER", "1", new Date());
```

Running `node index.js` causes the process to start and spawn a new worker every second. And indeed, if I edit the `worker.js` file the updates are displayed on the next execution of the file.

It should be feasible to build an HTTP server that loads in a worker on every request and processes the request with the latest copy of the code.
Dash Platform Development Update - 2022 October 4
Tags: web3, opensource, blockchain, programming
Published: 2022-10-05 16:59:46

Hey there, fellow Dashers!
We continue providing updates on Dash Platform development. 
Here's the freshest one.

{% embed https://www.youtube.com/watch?v=yOMbduMPzv0 %}

## TenderDash 
**Goals:** Same block execution

**Task**
- Stabilization of same-block execution **_in progress_**

## What’s Next
- Stabilization of same-block execution
- Investigate deadlocks in consensus

## GroveDB
**Goals:** Fee continuation and Sum Trees
**Tasks**
_Features_
- Sum Trees **_in progress_**
- Merk Sum Trees **_done_**
- GroveDB Interface **_done_**
- Sum Tree propagation **_in progress_**
- Removal on Root Tree storage **_in progress_**

**Trees explanation**
_Problem: We have a root tree storage that is incompatible with our fee model._

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

_Cost of the Parent Tree:_
- Key
- Value (32 bytes)
- Value Hash (32 bytes)

_Cost of the Top Node of Sub Tree:_
- Key
- Value
- Value Hash
- Root Storage Cost
- Key
- Path Hash

_Solution: Use Parent Trees to store the root key of underlying Merks._

_Cost Savings:_
- Key - Key (Cancels out)
- Path Hash (32 Bytes)
- Parent Root Hash (32 Bytes)

_Cost of the Parent Tree:_
- Key
- Sub Root Key
- Value Hash becomes Subtree Root Hash (32 bytes)

_Cost of the Top Node of Sub Tree:_
- Key
- Value
- Value Hash
~~Root Storage Cost 
Key
Path Hash~~

**What’s Next**
- Continuation of removal of root tree storage
- Verifying all cost tests
- Worst case costs after changes

## SDK
**Goals:** Rework chain synchronization process (SPV)

**Tasks**
- Unit tests **_75%_**
- Integration tests **_20%_**

**What’s Next**
- QA for refined transactions sync process
- Testing with platform on testnet

## Protocol
**Goals:** v0.23 alpha release

**Tasks**
_Alpha release of Dash Platform v0.23.0
Testnet upgrade to new architecture and OS will take about 2-3 days
Dashmate and SDK will be released as well_


- Add withdrawal to withdrawal queues in RS Drive **_in progress_**
- Implement helper container which will renew certificate automatically **_in progress_**
- Multi transaction support in Drive **_in progress_**
- Fixed 4 bugs **_done_**

**What’s Next**
- Continue on fee system
- Continue work on withdrawals
- Continue work on BLS Rust Bindings
- Continue work on HTTPS for DAPI
- Same Block Execution integration
- Release Platform v0.23

## Rust Port Update

**Tasks**
- Bring all changes from v23 into the Rust DPP port **_in progress_**
- Make previous JS DPP tests work with Rust DPP binding **_in progress_**
- Integrate Rust DPP into SDK, Drive, DAPI and test suite **_in progress_** 

**More detailed progress report**
- Porting v23 changes: Previously we’ve finished 16/21, current state is 18/21
- Right now we’re finalizing the API between Rust DPP and JS parts of the project: How do we handle data types that are exclusive to JS, like Buffers
How is the backward pass performed in MADDPG algorithm from MARL
Tags: python, machinelearning, marl, maddpg
Published: 2022-10-05 16:54:07



I'm using the MADDPG algorithm from https://github.com/openai/maddpg/blob/master/maddpg/trainer/maddpg.py. I understood the forward pass for both the actor and critic networks. I'm not able to understand how the actor and critic networks are updates. Like at line 188 and 191 the authors compute the critic loss and actor loss. But can anyone explain how the critic and actor networks are updated. Also, as far as I understand, when the number of agents increases from 3 to 6 for a simple spread policy in MADDPG, the computation time for Q loss and P loss at lines 188 and 191 increase super-linearly. I'm assuming this might be because both the Q loss and P loss utilize the Q values and the dimension to calculate the Q values increases with the number of increasing linearly. It would be great if anyone can help me to understand this back propagation phase much better and why does the computation time grow super-linearly. I also put a time counter to track the computation time of Q loss and P loss for 60,000 episodes with simple spread policy (3 agents, 3 landmarks, 0 adversaries). Thanks for the help, in advance!
`
**Q loss**
3 agents 74.31 sec
6 agents 243.31 sec (3X)
**P loss**
3 agents 114.86 sec
6 agents 321.76 sec (3x)`
Pinia Vue’s New State Management
Tags: webdev, javascript, beginners, podcast
Published: 2022-10-05 16:33:02


Original: https://codingcat.dev/podcast/2-42-Pinia-Vue-New-State-Management

{% youtube https://youtu.be/c9HzsWFjTfM %}

## Questions

1. Can you tell us more about yourself?
2. Why do you need state management in an application?
3. Why was the decision made to replace the old state system?
4. Is this the default state management tool for Vue?
5. Is there potential to bake it into it in the future?

## Links

* [Vue Pinia Playground](https://github.com/vuejs/pinia/tree/v2/packages/playground)
Failed to connect to the host via SSH on Ubuntu 22.04
Tags: ansible, packer, ubuntu, devops
Published: 2022-10-05 16:02:48

If you have just upgraded to Ubuntu 22.04, and you suddenly experience either errors when trying to ssh into hosts, or when running [ansible](https://docs.ansible.com/ansible/latest/index.html) or again when running the ansible provisioner building a [packer](https://packer.io) image, this is probably going to be useful for you.

In my case I was trying to build an AWS EC2 image via packer and the ansible provisioner, and I had this error:

```
amazon-ebs.aws: Failed to connect to the host via ssh: Unable to negotiate with 127.0.0.1 port
amazon-ebs.aws: 40015: no matching host key type found. Their offer: ssh-rsa
```

If your problem is that you simply can't connect via SSH to a host from your Ubuntu 22.04 host, then [look it up](https://duckduckgo.com/?q=ssh+PubkeyAcceptedKeyTypes+ssh-rsa), there are a lot of people in the same boat.

The proposed solution is to add this snippet to either your `/etc/ssh/ssh_config` or `~/.ssh/config`:

```
PubkeyAcceptedKeyTypes +ssh-rsa
```

or just for some specific hosts:

```
Host host.example.com
    PubkeyAcceptedKeyTypes +ssh-rsa
```

In the case of ansible connecting to a host, or packer launching ansible connecting to a host, this needs an additional step or two.

For ansible:

```
ansible --ssh-extra-args="-o PubkeyAcceptedKeyTypes=+ssh-rsa"
```

For packer with ansible provisioning:

```hcf
build {
  sources = ["sources.amazon-ebs.aws"]
  provisioner "ansible" {
    ansible_env_vars = [
      ...
      "ANSIBLE_SSH_ARGS='-o PubkeyAcceptedKeyTypes=+ssh-rsa -o HostkeyAlgorithms=+ssh-rsa'"
    ]
    playbook_file       = "..."
    galaxy_file         = "..."
    ...
    extra_arguments     = "${concat(local.default_ansible_extra_args, var.ansible_extra_args)}"
  }
}
```

Background info on the cause of this issue: https://ikarus.sg/rsa-is-not-dead/

Hope I don't need to come back to this for a while :-)