teleren/devto huggingface dataset:
599. Minimum Index Sum of Two Lists
Tags: java, leetcode, 100daysofcode, algorithms
Published: 2023-01-13 11:39:02

**Problem Statement:**

Given two arrays of strings list1 and list2, find the common strings with the least index sum.

A common string is a string that appeared in both list1 and list2.

A common string with the least index sum is a common string such that if it appeared at list1[i] and list2[j] then i + j should be the minimum value among all the other common strings.

Return all the common strings with the least index sum. Return the answer in any order.

**Example 1:**

**Input:** list1 = ["Shogun","Tapioca Express","Burger King","KFC"], list2 = ["Piatti","The Grill at Torrey Pines","Hungry Hunter Steakhouse","Shogun"]
**Output:** ["Shogun"]
**Explanation:** The only common string is "Shogun".

**Example 2:**

**Input:** list1 = ["Shogun","Tapioca Express","Burger King","KFC"], list2 = ["KFC","Shogun","Burger King"]
**Output:** ["Shogun"]
**Explanation:** The common string with the least index sum is "Shogun" with index sum = (0 + 1) = 1.

**Example 3:**

**Input:** list1 = ["happy","sad","good"], list2 = ["sad","happy","good"]
**Output:** ["sad","happy"]
**Explanation:** There are three common strings:
"happy" with index sum = (0 + 1) = 1.
"sad" with index sum = (1 + 0) = 1.
"good" with index sum = (2 + 2) = 4.
The strings with the least index sum are "sad" and "happy".
 

**Constraints:**

- 1 <= list1.length, list2.length <= 1000
- 1 <= list1[i].length, list2[i].length <= 30
- list1[i] and list2[i] consist of spaces ' ' and English letters.
- All the strings of list1 are unique.
- All the strings of list2 are unique.

**Solution:**
**Algorithm:**
1. Create a list to store the result.
2. Create a variable to store the minimum index sum.
3. Traverse the list1 and list2.
4. If the element of list1 is equal to the element of list2, then check if the index sum is less than the minimum index sum.
5. If the index sum is less than the minimum index sum, then clear the list and add the element to the list.
6. If the index sum is equal to the minimum index sum, then add the element to the list.
7. Return the list as an array

**Code:**
```
public class Solution {
    public String[] findRestaurant(String[] list1, String[] list2) {
        int min = Integer.MAX_VALUE;
        List<String> res = new ArrayList<>();
        for (int i = 0; i < list1.length; i++) {
            for (int j = 0; j < list2.length; j++) {
                if (list1[i].equals(list2[j])) {
                    if (i + j < min) {
                        res.clear();
                        res.add(list1[i]);
                        min = i + j;
                    } else if (i + j == min) {
                        res.add(list1[i]);
                    }
                }
            }
        }
        return res.toArray(new String[res.size()]);
    }
    
}
```

**Time Complexity:**
O(n*m) where n is the length of the list1 and m is the length of list2.

**Space Complexity:**
 O(n) where n is the length of the list1 and list2.
How can I download Twitter videos to my iOS or iPhone?
Tags: twiiter, video, download, mp4
Published: 2023-01-13 11:38:10

Videos and pictures posted on social media sites can now be saved to one's computer for later viewing or for sharing with people who aren't utilizing the same platform as oneself. By using a piece of software called Twitter Video Download, users of the Twitter social media site can transfer movies directly from Twitter to their Android or iOS-powered mobile devices. These videos will be made available to users in due time, but they will require credit whenever they are shared.

1.  Start the Documents app for free from the Apple Store.
2. - Search for the video or GIF you want to save on Twitter's desktop or mobile applications.
3. - There are four ways to respond to a tweet listed underneath it.
4. - Pointing at the icons on the right side of the screen may help you locate the share button.
5. - After that, select "Copy Link."
6. - The following step is to open the free Documents app and choose the Browser option from the toolbar.
7. - Go to that browser's address bar and type [twittervideodownload.com](https://twittervideodownload.com).
8. Copy the link and then paste it into the box on Twitter's video download page when you're ready.
9. After the Twitter video loads, a page with a Download Video button will be shown.
10. The resolution of the video can be adjusted by clicking on the corresponding icon.
11. After selecting the quality setting, you'll need to click the Download Video option again. In as short a time as possible, Twitter video downloads will go live.

**Twitter Downloader Advantages**

**Faster downloading.**

This plugin lets you download Twitter GIFs, movies, and photos quickly and well.

**compatibility**

This downloader works with smartphones, desktops, laptops, and tablets. It also supports all current browsers.

**It's natural.**

The Twitter MP4 downloader lets you copy-and-paste files. Twitter video downloads require these two actions.

**Free to use.**

Free Twitter video downloader. Downloads are unlimited.
The Power of Keywords: Unlocking the Potential of Digital Marketing
Tags: digitalmarketing, seo, ppc, design
Published: 2023-01-13 11:36:00

Keywords play a crucial role in [digital marketing ](http://digetala.com)as they help search engines understand the relevance and content of a website or webpage. When someone searches for a specific term or phrase, search engines use algorithms to determine which pages are most relevant to the user's query. By including relevant keywords in the website's content, meta tags, and alt tags, it makes it easier for search engines to understand what the website or webpage is about, and therefore, it will be more likely to appear in [search engine results pages (SERPs)](http://digetala.com) for those keywords. This can lead to an increase in website traffic and visibility for the website. At Digetala, we specialize in keyword research and optimization to ensure your website is reaching the right audience.
**[Some keywords that may attract more people to your business include:](http://digetala.com)** "discount," "sale," "limited time offer," "new," "exclusive," "free," "best," "top," "reviews," "compare," "deals," "cheap," "budget," "affordable," "quality," "reliable," "trusted," "experienced," "expect," "professional," "customer service," "satisfaction," "convenience," and "value." Additionally, it's important to include keywords related to your specific industry or product. For example, if you sell clothing, relevant keywords might include "fashion," "style," "apparel," "clothes," "accessories," and so on.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lah43w9vcxk7wg3qih4b.jpg)
Furthermore, keywords are also important for [pay-per-click (PPC)](http://digetala.com) advertising campaigns, as they help target specific audiences. By including keywords in ad campaigns, businesses can ensure that their ads are shown to individuals who are searching for those specific terms, which can increase the chances of them clicking on the ad and converting into customers. At Digetala, we also specialize in PPC campaigns and can help you select the right keywords to target the right audience.

[In summary, using relevant keywords in digital marketing](http://digetala.com) efforts can help increase website traffic, improve search engine rankings, and increase conversions. It is a crucial part of SEO, PPC and other digital marketing strategies to target the right audience and reach the right people at the right time. Researching and selecting the right keywords for a business is essential for a successful digital marketing campaign, and at Digetala, we can help you achieve that success.

**["Grow your business with Digetala's proven track record in digital marketing success."](http://digetala.com)**
Moving data from MongoDB to PostgreSQL using AWS Glue: A Guide
Tags: mongodb, postgres, aws, etl
Published: 2023-01-13 11:17:16


![Postgres ETL](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yeqvfffae9pxv1curlvi.png)

If you're working with a large amount of data, you may find that you need to move it from MongoDB to PostgreSQL. This can be a challenging task, but with the help of AWS Glue, it can be made simpler. In this article, we will discuss the steps that you need to take to move data from MongoDB to PostgreSQL using AWS Glue.

## Step 1: Connectivity

The first step in moving data from MongoDB to PostgreSQL is to ensure that your Glue job has the necessary connectivity to both the MongoDB and PostgreSQL databases. This may involve setting up VPC peering, security groups, or other networking configurations. It is important to ensure that your Glue job has the necessary permissions and credentials to access both MongoDB and PostgreSQL.

## Step 2: Data Structure

The next step is to make sure that the data structure in MongoDB is compatible with the schema in PostgreSQL. This may involve transforming the data as it's being loaded or using a Glue job to create the necessary tables in PostgreSQL. This is important because MongoDB is a document-based database, which allows for flexible and unstructured data, while PostgreSQL is a relational database which is more structured.

## Step 3: Data Types

Ensure that the data types used in MongoDB match the data types used in PostgreSQL. This may involve converting data types as part of the ETL process. This is important because MongoDB and PostgreSQL use different data types and if they are not matched properly it could cause errors while loading the data.

## Step 4: Security

Security is a crucial aspect of data migration. Make sure that you have the necessary permissions and credentials to access both MongoDB and PostgreSQL. You should also consider encryption of the data in transit and at rest.

## Step 5: Performance

When working with a large amount of data, performance is a key consideration. Keep an eye on the performance of the Glue job. You may need to adjust the number of Glue workers or the amount of memory allocated to the job to ensure that it runs efficiently.

## Step 6: Monitoring and Error Handling

AWS Glue allows you to monitor the ETL jobs, track the progress and handle errors. It is important to monitor the job and handle any errors that may occur during the data migration process.

## Step 7: Data Migration

There are different ways to handle data migration from MongoDB to PostgreSQL, you can either use Glue Job or other data migration tools such as Apache Nifi. The choice of the tool depends on the amount of data, data structure, and the complexity of the migration process.

## Conclusion

In conclusion, moving data from MongoDB to PostgreSQL using AWS Glue is a complex task, but with the right steps, it can be made simpler. By following the steps outlined in this article, you can ensure that your data migration process is smooth and successful.
Spring Boot Application Generator
Tags: springboot, devops, scaffolding, java
Published: 2023-01-13 10:57:44

The **Bootify Builder is an application generator** that can be used completely online without prior registration. [**Start a new project**](https://bootify.io/) and define your preferences and custom database schema. The generated code is available as a preview first, and the executable application can be downloaded at any time.

![](https://s3-eu-central-1.amazonaws.com/bootify-prod/ext/img/springRest/application-generator-preview.png "Result of the application generator as preview")
_&nbsp; Result of the application generator as preview_

The result is a **pure Spring Boot app in the current version 3.0.6 that follows best practices**. In the Free Plan, these features are directly available:

* Choose your own preferences like Maven or Gradle, Java or Kotlin, Lombok, and so on.
* Create a custom database schema to generate the **entities and relations for Spring Data / JPA**.
* If required, select a frontend stack based on Thymeleaf with Webpack, Bootstrap or Tailwind CSS. Create a **modern web application including live reload and build script integration**.
* **Enable CRUD functionality** as a REST API or for the frontend for any given entity.

Advanced features are available in the Professional Plan to make the initial prototype even more powerful. These include **integration test generation, Spring Security, changelogs for Liquibase or Flyway, multi-module projects**, and so on.

## Build your custom App Generator

With the DevOps Plan, the Bootify Builder and the **generated code can be customized to your own company**. This will provide a custom code generator that includes all the features of Bootify and always works with the latest version of Spring Boot. At the same time, **custom files and build script extensions can be added** - feel free to contact us to discuss your individual needs.

**Bootify puts the developer experience in the foreground**: First, the concept of a new application including database and interfaces is defined in the browser. This automatically provides the executable prototype, which meets the corporate standards with the DevOps plan and is directly integrated into the existing infrastructure.

[**&raquo; See Features and Pricing**](https://bootify.io/pricing.html)
FuzzingWeekly CW 2 — free hacking tools that are good for AppSec
Tags: security, testing, fuzzing, opensource
Published: 2023-01-13 10:49:51

These free tools for hackers are also good for application security QA: https://thestack.technology/free-fuzzing-tools-in-2023/

Fuzzing Hidden Directories & Files with Ffuf: https://blog.stealthsecurity.io/fuzzing-hidden-directories-files-with-ffuf/

Mozilla Disclosed 20 New CVEs Found With Fuzzing: https://nvd.nist.gov/vuln/search/results?form_type=Advanced&results_type=overview&query=fuzzing&search_type=all&isCpeNameSearch=false&pub_start_date=12%2F22%2F2022&pub_end_date=01%2F22%2F2023
Let's see wifi password using python
Tags: webdev, programming, python, tutorial
Published: 2023-01-13 10:46:56

Hey guys, welcome to the world of Python and wifi hacking... just kidding! In this article, we will be taking a look at a Python script that can be used to view the Wi-Fi password for a network you are currently connected to.

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

The script uses the subprocess module to run the command netsh wlan show profile [network name] key=clear. This command retrieves information about the specified network and the stdout=subprocess.PIPE redirects the output to a variable.

The output is then decoded and stored in the output variable. After that, the script splits the output into a list of lines, and iterates through each line. If a line contains the string "Key Content", the script extracts the wifi password from the line and prints it.

Here's the full script for your reference:

```
import subprocess

network_name = "Get your own wifi" #your_wifi_network_name

result = subprocess.run(['netsh', 'wlan', 'show', 'profile', network_name, 'key=clear'], stdout=subprocess.PIPE)
output = result.stdout.decode()

for line in output.split('\n'):
    if "Key Content" in line:
        print(line.split(":")[1].strip())

```
As you can see, this script is quite simple and straightforward. You just need to replace "Get your own wifi" with the name of the network you want to retrieve the password for.

And that's it, folks! With this script, you'll be able to hack into your own wifi network and retrieve the password in case you forget it!
Create and Query a NoSQL Table with Amazon DynamoDB
Tags: aws, cloud, awscommunity, 100daysofcloud
Published: 2023-01-13 10:39:06

[13/100] #100DaysOfCloud Today, I created a simple DynamoDB table, added data, scanned and queried the data, and deleted the table.

<u>DynamoDB :</u>
- Amazon DynamoDB is a fully managed, serverless, key-value NoSQL database service that provides fast and predictable performance with seamless scalability. DynamoDB lets you offload the administrative burdens of operating and scaling a distributed database so that you don't have to worry about hardware provisioning, setup and configuration, replication, software patching, or cluster scaling. DynamoDB also offers encryption at rest, which eliminates the operational burden and complexity involved in protecting sensitive data.

- With DynamoDB, you can create database tables that can store and retrieve any amount of data and serve any level of request traffic. You can scale up or scale down your tables' throughput capacity without downtime or performance degradation.

- DynamoDB provides on-demand backup capability. It allows you to create full backups of your tables for long-term retention and archival for regulatory compliance needs

- You can create on-demand backups and enable point-in-time recovery for your Amazon DynamoDB tables. Point-in-time recovery helps protect your tables from accidental write or delete operations. With point-in-time recovery, you can restore a table to any point in time during the last 35 days.

<u>Use cases :</u>
- Develop software applications
 - Build internet-scale applications supporting user-content metadata and caches that require high concurrency and connections for millions of users and millions of requests per second.

- Create media metadata stores
 - Scale throughput and concurrency for media and entertainment workloads such as real-time video streaming and interactive content, and deliver lower latency with multi-Region replication across AWS Regions.

- Deliver seamless retail experiences
 - Use design patterns for deploying shopping carts, workflow engines, inventory tracking, and customer profiles. DynamoDB supports high-traffic, extreme-scaled events and can handle millions of queries per second.

- Scale gaming platforms
 - Focus on driving innovation with no operational overhead. Build out your game platform with player data, session history, and leaderboards for millions of concurrent users.



You can try to create and query a NoSQL table with Amazon DynamoDB yourself by following the steps from the link below :
[GitHub](https://github.com/aaditunni/100DaysOfCloud/tree/main/Journey/013)
GitHub Copilot discovered me something isn't documented
Tags: javascript, react, testing, vscode
Published: 2023-01-13 10:38:34

Today I was writing a unit test for a React component. The first test I begin with is the "match snapshot test".

Copied right away [from the docs](https://jestjs.io/docs/snapshot-testing):

```js
import renderer from 'react-test-renderer';
import { MyComponent } from './my-component';

test('render: match snapshot', () => {
  const render = renderer.create(<MyComponent />).toJSON();
  expect(render).toMatchSnapshot();
})
```

This will create a `.snap` (text) file:

```
src
├── components
│   ├── __snapshots__               # <== creates this directory
│   │   ├── my-component.test.tsx.snap  # <== snapshot
│   ├── my-component
│   │   ├── my-component.scss
│   │   ├── my-component.tsx
│   │   ├── my-component.test.tsx
│   ...
```

Using `react-test-renderer` library:

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


So far so good. This is what it's documented.

***

Today I asked GitHub Copilot 🤖 to fill my test file. It suggested me something different instead:

```diff
-import renderer from 'react-test-renderer';
+import { render } from '@testing-library/react';
import { MyComponent } from './my-component';

test('render: match snapshot', () => {
-  const render = renderer.create(<MyComponent />).toJSON();
-  expect(render).toMatchSnapshot();
+  const { asFragment } = render(<MyComponent />);
+  expect(asFragment()).toMatchSnapshot();
})
```

Which doesn't need the extra dependency `react-test-renderer`.

I was like "_wait, does this work?_" 

It does.

It creates the exact file structure. So I came to the docs checking for the differences between `asFragment()` and `renderer.create().toJSON()`. But I haven't found good documentation on this regard.

***

Copilot's code works. Saves me one dependency. Proposed me a solution that isn't - well - documented and, in the end, **has surpassed me**.

This is interesting at the very least.

--
Thanks for reading 💚.
decimal128 vs double in MongoDB
Tags: mongodb, node, webdev
Published: 2023-01-13 10:09:47

When it comes to storing numbers in MongoDB, you've got two options: Decimal128 and Double. Think of Decimal128 like a fancy calculator with 34 decimal places of precision, perfect for financial and scientific calculations. Double, on the other hand, is like a regular calculator that's great for storing large range of numbers and doesn't require as much precision.

Let's say you're building a stock trading app. You'll want to use Decimal128 for storing the exact price of a stock to ensure accuracy for your users. But for storing the temperature in Celsius in a weather application, Double will be a better option as it's more efficient and doesn't require that level of precision.

Keep in mind, Decimal128 is not a native MongoDB data type, so you'll need to use a library like 'mongodb-decimal' to work with it. Double, however, is native to MongoDB, so no additional libraries are needed.

In short, Decimal128 is like a fancy calculator for precise calculations and Double is like a regular calculator for storing large range of numbers with less precision. Choose the one that best fits your needs and have fun!

Here are a few examples of how to use the Decimal128 data type in MongoDB:

Using the mongodb-decimal library:
You can use the mongodb-decimal library to work with Decimal128 data type in MongoDB. First, you need to install the library by running the following command:


```
npm install mongodb-decimal
```

Then you can use it in your code like this:

```
const Decimal128 = require('mongodb-decimal');
const decimalValue = new Decimal128("123.45");
// insert into a collection
await collection.insertOne({ value: decimalValue });

// find and update
await collection.updateOne({}, { $set: { value: new Decimal128("999.99") } });
```
Using the Decimal128 constructor:

```
const decimalValue = new Decimal128("123.45");

// insert into a collection
await collection.insertOne({ value: decimalValue });

// find and update
await collection.updateOne({}, { $set: { value: new Decimal128("999.99") } });
Using the Decimal128.fromString() method:
Copy code
const decimalValue = Decimal128.fromString("123.45");

// insert into a collection
await collection.insertOne({ value: decimalValue });

// find and update
await collection.updateOne({}, { $set: { value: Decimal128.fromString("999.99") } });
```
In all the examples above, the `decimalValue` variable holds the Decimal128 value, which can be inserted or updated into a MongoDB collection.

Note that these are just examples and you should make sure to handle any errors and also use appropriate MongoDB driver version to use Decimal128.