teleren/devto huggingface dataset:
Winds of Change...
Published: 2022-06-14 02:40:59

It was with heavy heart that I informed my mentorship team at [Perpetual Education](https://perpetual.education) that I would no longer be a part of their journey. Recent life events meant that I was merely pushing through rather than *learning for understanding*. As Derek said, PE should not become a to-do list, nor did I want it to become that. PE is an excellent program and I am thankful to have been a part of it. I’ll be in touch with my colleagues and mentor to see what awesome things they create. Also, **this is not the end of my programming and development journey.**

I’ve learned a lot from my time at PE, and I will continue to practice at my own pace. I am still going to write about my journey and my accomplishments moving forward, especially as I wade further into the ocean of programming and thinking like a programmer. 

Stay tuned~
![Quote about progress](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u3hvszq0sjjd2eelu9w3.png)
How Snapchat is using Machine Learning ?
Tags: machinelearning, datascience, deeplearning, ai
Published: 2022-06-14 02:39:00

_The very famous social media app **Snapchat** is all around the corner or let's in pocket of teens and even adults._

_While the addiction is concerning or not is still debatable, something surely concerning is what's circulating around the app._

**Creating Filters :**

For filters, Snapchat uses AI-powered lenses with small machine learning models to detect a face, differentiate the structures and features within it, and then create a 3D model face.

This process is completed using **"Image Processing"**, **"Facial Landmarks"** - plotting points on face and comparing it with collected data sets and active **"Shape Modelling"** which creates a virtual face and aligns it with the actual face.

**Targeting Ads :**

They call it as goal-based bidding which is an iterative improvement to advertising optimization on Snapchat.

The targeting technique allows advertisers to tell Snapchat whether they value ad engagement - such as swiping through to install an app, visit a website or watch a movie trailer - versus simply reaching the maximum number of users.

**Avoiding Drug Deals :**

Last October NBC News did a story about the troubling drug deals presumably taking place on the app. Which left everyone shocked.

In the report, it spoke about teens and young adults who had bought what they believed to be a prescription pill, but turned out to be a counterfeit pill containing deadly doses of fentanyl.

Since that report Snapchat has been ramping up its efforts to thwart drug deals on its platform.

Jan 18, Snap stated that it has a zero tolerance for drug dealing on Snapchat.

It states to deploy tools that proactively detect drug related content with the help of data, AI and ML in the matter, helping the law enforcement to support their investigations.

It will also provide in-app information and support to Snapchatters who search for drug-related terms through a new educational portal, Heads Up.

Snapchat's use of AI and ML proactively detects 88% of drug related content.

**Snapchat Machine Learning :**

Training Data -> Training Process -> .ONNX/.PB -> ML Components

Snap ML allows you to make your lenses even more intelligent with **Machine Learning**.

Just plug in an ML model to apply art style to the camera feed, use custom segmentation masks, attach images to custom detected objects, detected objects, understand what is in the scene and more.
How to read or convert an inputstream into a string in java? - Six easy ways
Tags: java, tutorial, programming, beginners
Published: 2022-06-14 02:35:40

In many development projects, we might need to convert an InputStream into a String in java. 
In this tutorial we will discuss simple and handpicked ways to read or convert an InputStream into a String in Java.
Depending upon your project configuration, you can use any of the following methods.   

For the purpose of this tutorial, lets assume "inputStream" is a variable of type InputStream.
``` Java
InputStream inputStream; 
```
Check the ways below. 

##### 1. Using Java 1.8+ inbuilt Streams package: 
```java
String result = new BufferedReader(new InputStreamReader(inputStream))
                    .lines().collect(Collectors.joining("\n"));
```
This method works with Java 1.8+ 

##### 2. Native Java Scanner way:  
```java
try (Scanner scanner = new Scanner(inputStream).useDelimiter("\\A")) {
    String result = scanner.hasNext() ? scanner.next() : "";
}
```
Note that "\\A" represents regex pattern for useDelimiter scanner method. 
"\A" stands for :start of a string! . So when this pattern is supplied, whole stream is ready into the scanner object.  

##### 3. Apache commons-io IOUtils way: 
```java
String result = IOUtils.toString(inputStream);
```
For this method, Apache commons-io library should be included into your project. You can include it with the below maven 
<a href="https://mvnrepository.com/artifact/commons-io/commons-io/2.6" target="_blank">maven</a> link. 

##### 4. Using Google Guava library:
```java
String result = CharStreams.toString(new InputStreamReader(inputStream));
```
For this method, Guava library should be included into your project. You can include it with the below maven
<a href="https://mvnrepository.com/artifact/com.google.guava/guava/r09" target="_blank">maven</a> link

#### 5. Spring Boot style: 
```java
String content = StreamUtils.copyToString(inputStream, StandardCharsets.UTF_8);
```
If you are using spring boot framework for your project you can use this. To include spring boot, you can use the below 
<a href="https://mvnrepository.com/artifact/org.springframework/spring-core/5.2.4.RELEASE" target="_blank">maven</a> repo

#### 6. Plain old ByteArrayOutputStream way: 
```java
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int length;
while ((length = inputStream.read(buffer)) != -1) {
    baos.write(buffer, 0, length);
}
String result = baos.toString();
```
If you want to play around with actual InputStreams without any utility methods you can use the above style. 


Bonus: How to read and write to file as a string in java in simple way : https://tipseason.com/how-to-read-file-as-string-in-java/

Tech interviews can be challenging if you don't practice the right set of questions. Follow our [group](https://www.facebook.com/groups/tipseason) for daily interview practice questions.
Longest Consecutive Sequence
Tags: leetcode, dsa, theabbie
Published: 2022-06-14 02:30:46

Given an unsorted array of integers `nums`, return _the length of the longest consecutive elements sequence._

You must write an algorithm that runs in `O(n)` time.

**Example 1:**

**Input:** nums = \[100,4,200,1,3,2\]
**Output:** 4
**Explanation:** The longest consecutive elements sequence is `[1, 2, 3, 4]`. Therefore its length is 4.

**Example 2:**

**Input:** nums = \[0,3,7,2,5,8,4,6,0,1\]
**Output:** 9

**Constraints:**

*   `0 <= nums.length <= 105`
*   `-109 <= nums[i] <= 109`

**SOLUTION:**

    class Solution:
        def longestConsecutive(self, nums: List[int]) -> int:
            nums = set(nums)
            maxLen = 0
            for num in nums:
                if (num - 1) not in nums:
                    l = 1
                    while (num + l) in nums:
                        l += 1
                    maxLen = max(maxLen, l)
            return maxLen
pandas打印显示所有行列并且不换行
Tags: pandas
Published: 2022-06-14 02:23:14

```python
# 显示所有的列
pd.set_option('display.max_columns', None)
#显示所有行
pd.set_option('display.max_rows', None)
# 加长宽度
pd.set_option('display.width', 5000)
```
Freea Audiobooks - Where to Find Them
Tags: boo
Published: 2022-06-14 02:15:07

If you have a library card, you're in luck - you can download thousands of freea audiobooks on your iPhone or iPod touch [horbuchkostenlos.de](https://horbuchkostenlos.de/). You'll find a huge range of books to suit a wide variety of tastes - including classics, children's books, and even audio dramas. Many of these are read by volunteer readers, which means that the quality can vary. You may also encounter accents and problems with audio quality, but you can still enjoy freea audiobooks without worrying about the quality.

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

If you're a true lover of romance, you can't go wrong with Pride and Prejudice, written by Jane Austen in 1813. The novel is full of wit and memorable characters, and its influence on modern love stories cannot be overstated. In addition to being a classic, this free audiobook is also read by Karen Savage, whose British accent is a perfect match for the story. Heart of Darkness is an unnerving story that inspired Francis Ford Coppola's classic Apocalypse Now. The story of a man who attempts to escape from the violence of the Congo River is a compelling tale that is packed with drama and twists.

The Internet Archive hosts thousands of freea audiobooks and poetry downloads. Using its search tool, you can find a book or an author you love and then listen to their readings. You can also search through various audiobook providers' archives using this portal. You can search by year, subject, and media type to find your favorite titles. ThoughtAudio offers classic literature and philosophy in audio form, ranging from F. Scott Fitzgerald to Mark Twain and Virginia Wolfe.

StoryNory is a great place to find freea audiobooks for kids. The collection contains both classic and original stories and is available in MP3 format. This service also offers text for those who are unable to read. And, as it's free, you're likely to find a lot of books that interest you. And you won't regret it! You can download them as MP3 files on your computer to listen to on the go.

For a more diverse collection of freea audiobooks, visit Librivox. This nonprofit site features volunteer readers reading public domain books for free. You can download them to your computer or use their iOS or Android app to listen online. The LibriVox app has a 4.8-star rating on iTunes. Browse through the catalog and choose what you like - it's all free and public domain! If you don't know where to begin, try searching by language, author, genre, and genre to find freea audiobooks.

If you want to get the most out of freea audiobooks, try out Orwell's 1984. This dystopian novel, written in the 1920s, has remained a relevant read in today's world. The novel has a heavy influence on Henry Ford's assembly lines, so you can't help but worry about what might happen in the future. In addition to audiobooks, you can also download ebooks of classic literature.
Laravel 9 - Use groupBy on Collections
Tags: laravel, webdev, php, programming
Published: 2022-06-14 02:11:57

If you want to group result by some condition which isn’t a direct column in your database, you can do that by providing a closure function.

```
$users = User::all()->groupBy(function($item) {
    return $item->created_at->format('Y-M-D');
});
```
Two Sum - O(n) Solution
Tags: cpp
Published: 2022-06-14 02:07:12

```cpp

class Solution {
public:
    vector<int> twoSum(vector<int>& nums, int target) {
        
        
        
        unordered_map<int, int> hash;
        vector<int> result;
        
        for (int i = 0; i < nums.size(); ++i)
        {
            int numToFind = target - nums[i];
            
            if (hash.find(numToFind) != hash.end())
            {
                result.push_back(hash[numToFind]);
                result.push_back(i);
                return result;
            }
            else
            {
                hash[nums[i]] = i;
            }
        }
        
        
        
        return result;
        
    }
};


```
Reorganize String
Tags: leetcode, dsa, theabbie
Published: 2022-06-14 02:00:56

Given a string `s`, rearrange the characters of `s` so that any two adjacent characters are not the same.

Return _any possible rearrangement of_ `s` _or return_ `""` _if not possible_.

**Example 1:**

**Input:** s = "aab"
**Output:** "aba"

**Example 2:**

**Input:** s = "aaab"
**Output:** ""

**Constraints:**

*   `1 <= s.length <= 500`
*   `s` consists of lowercase English letters.

**SOLUTION:**

    import heapq
    
    class Solution:
        def reorganizeString(self, s: str) -> str:
            op = ""
            ctr = {}
            for c in s:
                ctr[c] = ctr.get(c, 0) + 1
            heap = [(-n, c) for c, n in ctr.items()]
            hlen = len(heap)
            heapq.heapify(heap)
            while len(heap) > 0:
                currn, currc = heapq.heappop(heap)
                if currc != op[-1] if len(op) > 0 else True:
                    op += currc
                    if currn + 1 < 0:
                        heapq.heappush(heap, (currn + 1, currc))
                else:
                    if len(heap) == 0:
                        return ""
                    nextn, nextc = heapq.heappop(heap)
                    op += nextc
                    heapq.heappush(heap, (currn, currc))
                    if nextn + 1 < 0:
                        heapq.heappush(heap, (nextn + 1, nextc))
            return op
Values and Variable in JavaScript?
Published: 2022-06-14 01:58:42

**What is value?**

- 
A value is a fixed object.

- 
Or, a value is a definite item or entity.

- 
In the context of programming, A values can be a number, string, double, function, etc

*Note*: JavaScript function also produces a value!

**What is the use of value?**

- 
Values are used to perform calculations.

- 
Suppose, 10 & 20 are values, you can add, and subtract,  them using an operator!

**How to invoke or call value?**

- 
You can invoke or call your values with their name, which is a variable.

**What is a variable?**

- 
Variable is "bucket" for storing "water"

*Buckets => Memory*
*Water => Data or value*


- 
Or, variables are container/memory for storing data values.

- 
Or, A value stored in a variable.

- 
Or, A variable can be stored in any type of data, for example, number, string, etc.

- 
Or, a variable contains a value.

- 
Or, a variable is the name of the memory location.

😍That's all for now, thanks for reading this article to the end.

🔔 Don't forget to follow me on:


[Twitter](https://twitter.com/ATechAjay)
[LinkedIn](https://www.linkedin.com/in/atechajay/)
Expo Document Picker not working on IOS Bare Workflow
Tags: help, expo, reactnative
Published: 2022-06-14 01:55:55

UPDATE: I HAVE SOLVED THIS PROBLEM (it was a feature bug rather than the library's problem)...


Hello, I have been working on an app for my client which provides uploading specific documents. My previous co-developer uses expo-document-picker for uploading documents  and images. When I was testing to an IOS Simulator, it never worked. It is a bare workflow in Expo and it is working in Android platform but IOS platform is not working. I have followed this documentation on how to manage icloud also: https://docs.expo.dev/versions/latest/sdk/document-picker/#bare-workflow but it seems it never worked… I have also included some specific app.json for icloud like I included usesIcloudStorage in the app.json and the plugins expo-document-picker and the apple developer team and icloudenvironment to production… I dont know why it is never worked.

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

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

The output is when you click the button for the upload the documents, it will show the icloud library that you have in iOS phone.

When I clicked the button for uploading the document, it never worked.

I am using React Native
[pt-BR] 30 dias de Java
Tags: beginners, java, challenge, 30daysofcode
Published: 2022-06-14 01:41:00

Ultimamente eu tenho dedicado meu tempo para aprender mais de Java (não, não vou virar fã de linguagem de programação).
Com isso, tenho me esforçado para entender mais, desde os fundamentos de lógica de programação até alguns detalhes, ímpares, dessa linguagem. 
Com certeza uma das conclusões que tenho tido é sobre a importância de não pular as etapas de aprendizado. O básico é o que nos leva ao avançado.

Para aprimorar mais, tenho lido, em inglês mesmo, o livro "Head first: Java", pela O'Reilly Media, que é um livro excelente e que usa uma metodologia um pouco diferente para o aprendizado.

Além dos cursos que tenho feito e que envolvem Java, também comecei o desafio do HackerRank, que dura 30 dias. Lá vemos os exercícios diários e que abordam diversos tópicos de Java.

No começo algumas coisas terminam sendo genéricas, mas, ao passar do tempo, os detalhes passam a fazer muita diferença. Inclusive os pequenos detalhes de aprendizado.
Smooth and easy-to-use Access Node API
Published: 2022-06-14 01:40:27

If you're a #developer and you need to interact with #blockchains to retrieve on-chain #data, we want to help you!
With our new user-friendly Access node API portal, you can manage and track your requests.

In celebration of the launch of our portal, we're giving away $100 credits to use on our access node API portal.

Make sure to follow ALL these steps to qualify: 
1. Follow us on [LinkedIn](https://www.linkedin.com/company/rockx-official) to stay up to date with our new products
2. Create an account on our portal https://bit.ly/3M0fPS8
3. Fill in the form to claim your credits: https://lnkd.in/duxWziyk
We'd also be happy to hear your feedback about our product through any of our social channels or the chatbot or on our website!
Python .env
Tags: python, environement, security
Published: 2022-06-14 01:08:26

If your application takes its configuration from environment variables, like a 12-factor application, launching it in development is not very practical because you have to set those environment variables yourself.

```
pip install python-dotenv
```

To help you with that, you can add Python-dotenv to your application to make it load the configuration from a .env file when it is present (e.g. in development) while remaining configurable via the environment:

```
from dotenv import load_dotenv

load_dotenv()  # take environment variables from .env.
```

Code of your application, which uses environment variables (e.g. from os.environ or
os.getenv) as if they came from the actual environment.
By default, load_dotenv doesn't override existing environment variables.

To configure the development environment, add a .env in the root directory of your project:

`.
├── .env
└── foo.py`

The syntax of .env files supported by python-dotenv is similar to that of Bash:

```
# Development settings
DOMAIN=example.org
ADMIN_EMAIL=admin@${DOMAIN}
ROOT_URL=${DOMAIN}/app
```
If you use variables in values, ensure they are surrounded with { and }, like ${DOMAIN}, as bare variables such as $DOMAIN are not expanded.


You will probably want to add .env to your .gitignore, especially if it contains secrets like a password.
Minimum Deletions to Make Array Beautiful
Tags: leetcode, dsa, theabbie
Published: 2022-06-14 01:00:47

You are given a **0-indexed** integer array `nums`. The array `nums` is **beautiful** if:

*   `nums.length` is even.
*   `nums[i] != nums[i + 1]` for all `i % 2 == 0`.

Note that an empty array is considered beautiful.

You can delete any number of elements from `nums`. When you delete an element, all the elements to the right of the deleted element will be **shifted one unit to the left** to fill the gap created and all the elements to the left of the deleted element will remain **unchanged**.

Return _the **minimum** number of elements to delete from_ `nums` _to make it_ _beautiful._

**Example 1:**

**Input:** nums = \[1,1,2,3,5\]
**Output:** 1
**Explanation:** You can delete either `nums[0]` or `nums[1]` to make `nums` = \[1,2,3,5\] which is beautiful. It can be proven you need at least 1 deletion to make `nums` beautiful.

**Example 2:**

**Input:** nums = \[1,1,2,2,3,3\]
**Output:** 2
**Explanation:** You can delete `nums[0]` and `nums[5]` to make nums = \[1,2,2,3\] which is beautiful. It can be proven you need at least 2 deletions to make nums beautiful.

**Constraints:**

*   `1 <= nums.length <= 105`
*   `0 <= nums[i] <= 105`

**SOLUTION:**

    class Solution:
        def minDel(self, nums, i = 0, switch = False, dels = 0):
            n = len(nums)
            if i >= n:
                if (n - dels) % 2 == 0:
                    return 0
                return 1
            if switch:
                if i < n - 1 and i % 2 == 1 and nums[i] == nums[i + 1]:
                    return 1 + self.minDel(nums, i = i + 1, switch = False, dels = dels + 1)
                return self.minDel(nums, i = i + 1, switch = True, dels = dels)
            else:
                if i < n - 1 and i % 2 == 0 and nums[i] == nums[i + 1]:
                    return 1 + self.minDel(nums, i = i + 1, switch = True, dels = dels + 1)
                return self.minDel(nums, i = i + 1, switch = False, dels = dels)
        
        def minDeletion(self, nums: List[int]) -> int:
            return self.minDel(nums, i = 0, switch = False, dels = 0)
turn your website to android app in a few minutes and publish to google play
Tags: news, angular, react, vue
Published: 2022-06-14 00:43:05

[**URLgApp**](https://urlgapp.com/generator) is an online tool to convert website to Android app. It takes a URL of a website from you along with some other details for the app and then generate an APK file. Not only that but if you are planning to deploy the app on Google Play Store then you can do that. In that case, you can specify Google Play key, app logo, and package name and then your app will be ready to be published on play store.

that you can use to convert any website to Android app. There is no registration or sign up process to get started. You only have to simply fill the information on the main website and wait for it to generate the Android app.

On the main website, it follows a queue system. If there are multiple people using it at the same time, then you will have to wait for your turn to get your APK build in process.

**How to Convert Website to Android app ?**

Since there is no sign or registration, just go to the main homepage. On the main UI, you will see some fields that you have to fill out in order to get the corresponding APK file. The main UI looks like this.


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


Now, you have to enter everything that it asks there. Specify the link of the website for which you want to get the corresponding Android app. Along with the URL, you specify an app logo and some other information.

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

Just hit the “Generate app” button and then let it do the rest. If you are number 1 in queue, then it will start building your app right away.


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

After it is done, it will give you 3 files which you will need to deploy your app on Google Play Store. If you are running Windows 11 then you can install APK file on your PC.

https://urlgapp.com/generator

also have section if you want to convert html , css ,js to android app check 

https://urlgapp.com/htmlgapp