teleren/devto huggingface dataset:
1704. Leetcode Solution in CPP
Tags: cpp
Published: 2022-07-08 15:53:44

```
class Solution {
    int count(string s) {
        int cnt = 0;
        for (char c : s) {
            c = tolower(c);
            cnt += c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
        }
        return cnt;
    }
public:
    bool halvesAreAlike(string s) {
        return count(s.substr(0, s.size() / 2)) == count(s.substr(s.size() / 2));
    }
};
```
#leetcode
#challenge
here is the link for the problem:
https://leetcode.com/problems/determine-if-string-halves-are-alike/
1688. Leetcode Solution in CPP
Tags: cpp
Published: 2022-07-08 15:52:27

```
class Solution {
public:
    int numberOfMatches(int n) {
     return n > 1 ? n / 2 + numberOfMatches((n + 1) / 2) : 0;
    }
};
```
#leetcode
#challenge
here is the link for the problem:
https://leetcode.com/problems/count-of-matches-in-tournament/
1614. Leetcode Solution in Java
Tags: java
Published: 2022-07-08 15:49:37

```
class Solution {
    public int maxDepth(String s) {
        int left = 0;
        int max = 0;
        for (char c : s.toCharArray()) {
            if (c == '(') {
                left++;
            } else if (c == ')') {
                left--;
            }
            max = Math.max(max, left);
        }
        
        return max;
    }
}
```
#leetcode
#challenge
here is the link for the problem:
https://leetcode.com/problems/maximum-nesting-depth-of-the-parentheses/
Paracetamol.js💊| #161: Explica este código JavaScript
Tags: javascript, webdev, spanish, programming
Published: 2022-07-08 15:32:22

## **<center>Explica este código JavaScript</center>**
#### <center>**Dificultad:** <mark>Básico</mark></center>

```js
const f = arr => arr.every(number => number > 1 && number < 5)
console.log(f([2,4,3]))?
```

A. `true`
B. `[2, 4]`
C. `false`
D. `[1]`

Respuesta en el primer comentario.

---

Respuesta:
A. `true`

`every` es un array method que permite evaluar **todos** los items de un arreglo en base a una condición. En este ejemplo todos los valores del arreglo deben cumplir que sean mayores a 1 pero menores que 5, todos sin ninguna excepción.

El arreglo cumple con esa condición, entonces la función regresa un `true`. `every` siempre regresa un bolean.
Device Sizes for CSS Media Queries
Tags: webdev, css, tutorial, beginners
Published: 2022-07-08 15:30:28

When dealing with Responsive Web Designs you will have to use `@media` queries to change the look of your website in different device sizes. 

In this blog post, you can find different device sizes you can use with your @media queries.

##Phones
```
(min-device-width : 320px) and (max-device-width : 480px)
```

##Teblets
```
(min-device-width : 481px) and (max-device-width : 768px)
```

##IPads
```
(min-device-width : 769px) and (max-device-width : 1024px)
```

##IPads pro, Tablets pro
```
(min-device-width : 1025px) and (max-device-width : 1366px)
```

##Laptop
```
(min-device-width : 1367px) and (max-device-width : 1760px)
```

##Large Screen
```
(min-device-width : 1760px) and (max-device-width : 1920px)
```

___

**If you found the content i share useful then share it with your developer friends and also follow me on [Instagram](https://www.instagram.com/gaurav_vaala/) and [Twitter](https://twitter.com/gaurav_vaala)**
1598. Leetcode Solution in CPP
Tags: cpp
Published: 2022-07-08 15:26:00

```
class Solution {
 public:
  int minOperations(vector<string>& logs) {
    int ans = 0;

    for (const string& log : logs) {
      if (log == "./") continue;
      if (log == "../")
        ans = max(0, ans - 1);
      else
        ++ans;
    }

    return ans;
  }
};

```
#leetcode
#challenge
here is the link for the problem:
https://leetcode.com/problems/crawler-log-folder/
How I decided to become a web developer at age 35
Tags: webdev, beginners, programming, career
Published: 2022-07-08 15:25:00

This is a thumbs up for all those who believe it is never too late to change direction later in life. 
My career path has been anything but linear. I have always been a curious person, eager to learn new things so it has always been difficult for me to commit to a course or study or a career for a lifetime. I studied political science and worked for nearly 10 years in the non-profit and public sector. After a while, I became restless and decided that I needed a change. I have always been a big art lover so I first started to venture into the world of design. Because I was in full-time employment at the time, I opted for a part-time study and enrolled for a distance learning degree in visual communications at the Open College of the Arts (UK). Meanwhile, I discovered [SuperHi](https://www.superhi.com/), an online school targeted at designers and other creative professionals who want to learn coding. Because the tutors are very engaging and available and the projects are fun and visually very appealing, SuperHi is what really got me hooked on coding! After passing foundational HTML, CSS and JavaScript I took a deep dive with other frameworks and technologies: React, Wordpress, Shopify, Ruby on Rails... 
In 2019 I moved to Italy taking a career break. I had time to focus on my studies and improve my programming skills. I took part in a three-month intensive bootcamp organized by [Aulab](https://aulab.it/), a software house in Bari, which in addition to the front-end fundamentals also gave me an introduction to back-end coding with Laravel. At the end of the course and after a few short gigs, I was lucky to be hired for my first developer job at [Avanade](https://www.avanade.com/) where I am now working on large-scale enterprise applications using Angular. 
It has been and still is a bumpy ride. For people like me with training in humanities and an atypical background programming has a particularly steep learning curve. I still continue to learn every day and try to add new skills to my tool box. This year I am also taking courses in UX/UI Design since I would like to move more into UI and/or mobile development. 
Starting anew at age 35 is definitely not easy and it can be humbling to have colleagues who are much younger than you and with much more experience to coach you. You have to leave your ego behind and adopt a growth mindset - although it will be tough, don't think "I can't do this", but rather "I can't do this... yet."
1592. Leetcode Solution in CPP
Tags: cpp
Published: 2022-07-08 15:23:11

```
class Solution {
 public:
  string reorderSpaces(string text) {
    const int spaces = count(begin(text), end(text), ' ');
    string ans;
    vector<string> words;

    istringstream iss(text);
    string word;

    while (iss >> word)
      words.push_back(word);

    if (words.size() == 1)
      return word + string(spaces, ' ');

    const int gapSize = spaces / (words.size() - 1);
    const int remains = spaces % (words.size() - 1);

    for (int i = 0; i < words.size() - 1; ++i)
      ans += words[i] + string(gapSize, ' ');
    ans += words.back() + string(remains, ' ');

    return ans;
  }
};

```
#leetcode
#challenge
here is the link for the problem:
https://leetcode.com/problems/rearrange-spaces-between-words/
AWS S3 Storage(Simple Storage Service)
Tags: aws
Published: 2022-07-08 15:21:35

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

- S3 Storage has a simple web service interface that we can use to store and retrieve any amount of data at any point in time and from anywhere on the web.

- This is generally used for backup storage 

- S3 is an object storage system, there is no root storage available.

- We don't require any operating system for S3 storage like EC2 Instance.

- S3 buckets are Flat Containers which means we can store files inside a bucket but we can't create another bucket inside a bucket and store the files.

- The **Maximum Storage** of the S3 Bucket is **5TB**.

- The **maximum no of the bucket** we can create i.e only **100 S3 buckets**.

## Feature of S3 Bucket

1. **Durability** - It is **99.999999%** durable. It maintains its durability by quickly detecting and repairing any lost redundancy.

2. **Flexible** - There are various types of S3 storage available and you can easily change from one type to another 

3. **Secured**- There are various types of policies and encryption available to keep the data secure.

4. **Cost-effective**- It is very cheapest of all the storage

These are mostly used.

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

 

# S3 Versioning 

- Use of versioning is to multiple versions of an object in one bucket.
- Generally, it keeps a copy of the old file over the new file.


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

 
#Cross Region Replication
Create S3 Bucket-> Go to Management -> Replication Rule -> Create rule.
- It enables automatic asynchronous copying of an object across buckets in different AWS regions.
- Buckets configured for Cross Region Replication (CRR) can be owned by the same account or different accounts.

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

# S3 Transfer Acceleration 
- Amazon S3 Transfer Acceleration can speed up content transfers to and from Amazon S3 by as much as 50-500% for long-distance transfer of larger objects.
- S3 Transfer Acceleration (S3TA) reduces the variability in Internet routing, congestion, and speeds that can affect transfers, and logically shortens the distance to S3 for remote applications
Summer of Bitcoin Journey
Published: 2022-07-08 15:14:00

## The Project

I was accepted for “**Graphical Wallet for [Fedimint](https://github.com/fedimint/fedimint) using WASM”.** 

Fedimint is an experimental implementation of federated e-cash written in Rust. Currently, there is only a CLI client. A GUI client will be crucial for widespread adoption, allowing non-technical people to use MiniMint. Packaging the client as Web Assembly will help make more native clients such as an Android app.

## [Compile to Web Assembly](https://github.com/fedimint/minimint/pull/140/commits)

Compiling Rust to Web Assembly is very simple. We just need to avoid crates that don’t work on Web Assembly. We had to remove and update some crates.

### async runtimes

Minimint uses [tokio](https://tokio.rs) runtime, which is not compatible with Web Assembly. 

Luckily, we have [wasm-bindgen-futures](https://rustwasm.github.io/wasm-bindgen/reference/js-promises-and-rust-futures.html) that allows to interop between Rust Futures and JavaScript Promises. We just had to add some [helper functions](https://github.com/fedimint/minimint/commit/fb2b140c6540e70d6081acd9693cfcd16d3d75a3) to replace the tokio usage.

### Disentangling mint-client from minimint server

Mint client depended on the server for various type definitions and modules. I fixed this by [separating out a minimint-core](https://github.com/fedimint/minimint/commit/6c8edb1200297ac11a207aad553d03fa9e0ced94https://github.com/fedimint/minimint/commit/6c8edb1200297ac11a207aad553d03fa9e0ced94) that both server and client can depend on.

## [Web Sockets](https://github.com/fedimint/minimint/pull/203/commits)

Minimint server uses http for its API. Each module can expose api endpoints. Due to http, we had to use polling to fetch transaction. With web sockets, we will use jsonrpc for fully async request and responses.

## Graphical Client

[futurepaul](https://github.com/futurepaul) and [justinmoon](https://github.com/justinmoon) have already been working on a [flutter based client](https://github.com/futurepaul/fluttermint). I am working on getting it to [run inside a web browser](https://github.com/Maan2003/fluttermint/tree/wasm). It is so awesome seeing fluttermint run inside Firefox.

A bunch of changes later and bug squashes later, paying and recieve lightning payments works!

{% vimeo 743471444 %}

## Thanks

I would like to thank my mentor [elsirion](https://github.com/elsirion) and all the reviewers for helping me throughout this and for quick responses and reviews.
Keychron K5 Function Keys + Unstable Bluetooth fix - Ubuntu 22.04
Tags: keychron, keyboard, ubuntu
Published: 2022-07-08 14:14:03

If you have problem getting the F1 - F12 (Function) keys to work, and unstable bluetooth connection on your new Keychron K5 keyboard, this will hopefully help you.

Here are the fixes that worked for me on Ubuntu 22.04.

## Fixing top row keys as F1 to F12

So you can actually use the function key row as function keys:

1. Set keyboard to Windows mode (use hardware switch)
2. Hold Fn + X + L for 4 seconds to switch to "Function" mode
3. Apply the fix temporarily --> check if it's working:

    ```bash
    echo 0 | sudo tee /sys/module/hid_apple/parameters/fnmode
    ```

4. Apply the fix permanently:

    ```bash
    echo "options hid_apple fnmode=0" | sudo tee -a /etc/modprobe.d/hid_apple.conf
    sudo update-initramfs -u
    ```

5. Reboot (to verify)


## Fixing unstable Bluetooth Connection

Before this fix the keyboard would randomly disconnect.

After this fix, not a single glitch the entire workday 😋

1. Enable fast connect:

    Edit `/etc/bluetooth/main.conf` - uncomment and set these values:

    ```bash
    FastConnectable = true
    ReconnectAttempts=7
    ReconnectIntervals=1, 2, 4
    ```

2. Disable bluetooth auto suspend

    ```bash
    echo "options btusb enable_autosuspend=n" | sudo tee /etc/modprobe.d/btusb_disable_autosuspend.conf
    sudo update-initramfs -u
    ```

3. Restart bluetooth

    ```bash
    sudo modprobe -r btusb
    sudo systemctl restart bluetooth
    sudo modprobe btusb
    ```

4. Factory reset keyboard (Hold Fn + Z + J for 4 seconds) --> Re-pair keyboard

    This makes no sense but it did seem to make a difference...


## Credits

This post is possible thanks to these awesome people:

- [Mike Shade](https://mikeshade.com/posts/keychron-linux-function-keys/)
- [andrebrait](https://gist.github.com/andrebrait/961cefe730f4a2c41f57911e6195e444)
My New Romantic Project in Python
Tags: python
Published: 2022-07-08 14:13:36


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





I tried to see photos and play My favorite ringtone of the Popular TV Show Kuch Rang Pyaar ke Aise bhi using Python Programming. My project is like very romantic for Krpkabians or Shaheer Shiekh Lovers or Erica Fernandez lovers. Hope whenever and whoever will see this will definitely get excited.


The tragedy is that i Cannot upload the video to show You.

#python
#pythonproject
#krpkab
#shaheersheikh
#ericafernandes

If you want the source code and Audio Clip.....
You can Visit here👇👇👇👇👇👇
https://github.com/Chiki1601/Devakshi
webMethods.io Integration workflow: Request data from a source and regularly send an email with the content
Tags: webmethods, webmethodsintegration, cloud
Published: 2022-07-27 13:39:10

---
title: webMethods.io Integration workflow: Request data from a source and regularly send an email with the content
published: true
date: 2022-07-08 13:51:59 UTC
tags: webMethods, webMethodsIntegration, Cloud
canonical_url: https://tech.forums.softwareag.com/t/webmethods-io-integration-workflow-request-data-from-a-source-and-regularly-send-an-email-with-the-content/258952
---

 

## Overview

This tutorial describes a [webMethods.io Integration](https://www.softwareag.cloud/site/product/webmethods-io-integration.html) workflow which is triggered at a certain time, and it’s used to send an email to respective audience with requested data from Discourse platform.

We use this example to remind our moderators once a week about unanswered topics on our platform. In the Discourse community platform, such functionality is missing and using [webMethods.io Integration](https://www.softwareag.cloud/site/product/webmethods-io-integration.html) to create it turned out to be much easier than creating a Discourse plugin.

## Steps

Check out the [original post](https://tech.forums.softwareag.com/t/webmethods-io-integration-workflow-request-data-from-a-source-and-regularly-send-an-email-with-the-content/258952) in the Software AG Tech Community to find the step-by-step tutorial.
TOP 5 Flutter Packages! That many apps should be used.
Tags: flutter, dart, programming, beginners
Published: 2022-07-08 13:51:07

## **1) [Alchemist](https://pub.dev/packages/alchemist):**
A package designed to enhance golden testing. This package, developed by Betterment x VGV, contains a declarative API and addresses some pain points of golden test support within the Flutter frame — similar to fixing nonstop integration test flakes and simplifying edging in a custom theme. Then’s a blog about how to use alchemist with your golden tests.
.
.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0qrzm986v0dg4ybw8j1g.PNG)
.
.
## **2) [Collection](https://pub.dev/packages/collection):**
This package from the Dart platoon is a must-have if you’re using collections in your codebase. The collection contains functions to help with equivalency within a collection's rudiments and between collections, list operations, precedence line perpetration, and wrappers.
.
.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pje0tbjhofti8nh7qj9n.PNG)
.
.
## **3) [Equatable](https://pub.dev/packages/equatable):**
A small but helpful package for comparing Dart objects. This package overloads the driver and allows you to reach objects without law generation.
.
.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fh8a0xvb58qd5sv405j6.PNG)
.
.
## **4)[Flutter_gen](https://pub.dev/packages/flutter_gen):**
In Flutter, using a string to specify a path to an asset isn’t safe. For illustration, an assertion error can be thrown if you accidentally mistype the asset path.flutter_gen is a law creator for means, sources, colors, and more, effectively getting relieved of string-grounded APIs.
Withflutter_gen, you can use law generation to induce collect-safe asset references rather than strings for asset paths.
.
.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/usd8towcq5nydd599o5c.PNG)
.
.
## **5)[url_launcher](https://pub.dev/packages/url_launcher):**
True to its name, the url_launcher Flutter package is an accessible way to launch external URLs from your operation with numerous URL schemes supported. Use this package when you want to calculate on the beginning platform to handle opening the URL for you.
.
.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ly2lp0mneivv9k2x2wjy.PNG)
What is complexity? Write Better Laravel
Tags: laravel, programming, codequality, php
Published: 2022-07-08 13:40:27

> “Write Better Laravel” is a new blog series about designing sustainable, clean code.

In order to write better code, we first must understand our enemy.

- What is “complexity”?
- How can you tell if the system is unnecessarily complex?
- What causes the system to become complex?

Once you understand complexity and how to spot it, you will start writing better code that is simpler to understand, use, extend and maintain.

> **Complexity** is anything related to the structure of a software system that makes it hard to understand and modify the system.

[Click here to read the rest of the article...](https://arunas.dev/write-better-laravel-what-is-complexity/)
Introduction to ceramic.network for web3 developers
Tags: web3, ceramicnetwork, scams
Published: 2022-07-08 13:39:56

# Introduction
Hi! This is my first post here :). I would like to share with you about this new framework & network that [ceramic.network](ceramic.network) is.

As I'm developing a solution against scams related to cryptocurrency, I got the chance to work daily with this unexplored web3 framework.

## What is ceramic network?

It's a P2P decentralized database where you authenticate yourself using your DID and only you can update your data (DID = decentralized digital identity).
DIDs are like cryptocurrency wallets, basically a private/public key combination. And if you show someone your DID identifier he/she can find and read what you wrote into ceramic’s network.

Looks like a smart contract that deployed where the user got write access, doesn't it? Yes indeed! But this is way better (see the below why).

## How does ceramic network works ?

Under the hood, ceramic use IPFS to replicate data across nodes, DIDs to check who owns what and is allowed to update content.
It also uses [json-schema](https://json-schema.org/) to check that updates to documents are valid and to improve discoverability.
To finish commits are anchored to a blockchain.

## Why not simply use IPFS to build a web3 app?

Well IPFS is nice but: every time you update a document you effectively create a new one! This is because the document hash changes therefore the file identifier too!
With ceramic, the DID (identifier) and the StreamId (document identifier) remain the same. So you know where to look for the information you want, while the document can be updated.
It's a bit more like web2: You enter a website address and go see the latest version of it. Here the address is the DID and you can read documents associated with it from the datastore.

## Conclusion

I have high hopes for this framework and I keep on building [swearby to help people find trustworthy crypto projects and dodge scams](https://swearby.io) with it.

I believe it was a big missing piece in the web3 ecosystem: 
Having a way to store user data in a decentralized manner such as:
- Data are discoverable
- Users own their data
- Data are cryptographically signed
- Users don't need tokens to update, read, or write data.

Thanks for reading! And Let me know in the comments if you are interested in a *getting started developing with ceramic network* tutorial!