teleren/devto huggingface dataset:
My first post
Published: 2022-04-30 21:45:17

I write here with no intention to really garner any real audience but document my journey as a self-taught programmer. I'd like to keep my posts as concise and spontaneous as possible. As I tend to overthink things and do not want to waste either of our time. Consider this my disclaimer on the off chance I start to gain traction, that what I type here is coming from a 19 year with less than a year of experience. 

 With that said, I'd like to go over what I love about software and programming in general:

- Community
- Open source ideology
- High leverage skill
- Ability to create/innovate
- Abstract way of thinking
NVIDIA Cheminformatics on AWS
Tags: cheminformatics, aws, nvidia, healthtech
Published: 2022-04-30 18:20:04


 NVIDIA 𝘾𝙝𝙚𝙢𝙞𝙣𝙛𝙤𝙧𝙢𝙖𝙩𝙞𝙘𝙨 𝙤𝙣 𝙩𝙝𝙚 Amazon Web Services (AWS) 𝘾𝙡𝙤𝙪𝙙 is designed for 𝙘𝙝𝙚𝙢𝙞𝙨𝙩𝙨 𝙖𝙣𝙙 𝙝𝙚𝙖𝙡𝙩𝙝 𝙘𝙖𝙧𝙚 𝙨𝙘𝙞𝙚𝙣𝙩𝙞𝙨𝙩𝙨 who want to explore 𝙈𝙚𝙜𝙖𝙈𝙤𝙡𝘽𝘼𝙍𝙏, a transformer model of the latent space of small molecules obtained through self-supervised learning of compound 𝙎𝙈𝙄𝙇𝙀𝙎.

Thanks to John Smith, Doruk Ozturk, and Troy Ameigh for their 𝙌𝙪𝙞𝙘𝙠 𝙎𝙩𝙖𝙧𝙩 𝙂𝙪𝙞𝙙𝙚 which can serve as a 𝙥𝙧𝙤𝙤𝙛 𝙤𝙛 𝙘𝙤𝙣𝙘𝙚𝙥𝙩 for:
(1) 𝙗𝙞𝙜 𝙥𝙝𝙖𝙧𝙢𝙖𝙘𝙚𝙪𝙩𝙞𝙘𝙖𝙡 and
(2) 𝙨𝙩𝙖𝙧𝙩-𝙪𝙥 companies
that are curious about 𝙧𝙚𝙥𝙧𝙚𝙨𝙚𝙣𝙩𝙖𝙩𝙞𝙤𝙣𝙖𝙡 𝙡𝙚𝙖𝙧𝙣𝙞𝙣𝙜 for compounds or 𝙜𝙚𝙣𝙚𝙧𝙖𝙩𝙞𝙫𝙚 𝙘𝙝𝙚𝙢𝙞𝙨𝙩𝙧𝙮 before implementing 𝘾𝙝𝙚𝙢𝙞𝙣𝙛𝙤𝙧𝙢𝙖𝙩𝙞𝙘𝙨 in their own environments.

𝙉𝙑𝙄𝘿𝙄𝘼 𝘾𝙝𝙚𝙢𝙞𝙣𝙛𝙤𝙧𝙢𝙖𝙩𝙞𝙘𝙨 𝙤𝙣 𝙩𝙝𝙚 𝘼𝙒𝙎 𝘾𝙡𝙤𝙪𝙙: 𝙌𝙪𝙞𝙘𝙠 𝙎𝙩𝙖𝙧𝙩 𝘿𝙚𝙥𝙡𝙤𝙮𝙢𝙚𝙣𝙩 𝙂𝙪𝙞𝙙𝙚
https://aws-quickstart.github.io/quickstart-nvidia-cheminformatics/

𝙎𝙩𝙖𝙮 𝙩𝙪𝙣𝙚𝙙 𝙗𝙮 𝙛𝙤𝙡𝙡𝙤𝙬𝙞𝙣𝙜
https://www.linkedin.com/feed/hashtag/didAbRyouAbRknowAbRthat/

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k53fa9mt79z5qjynt8zx.jpeg)
Menggunakan Factory Method Untuk Membuat Object
Tags: javascript, beginners, programming
Published: 2022-04-30 21:30:32

Hai teman-teman 👋

Kali ini saya akan membagikan tentang penggunaan factory method. Pada umumnya, ketika kita akan membuat object, maka kita langsung melakukan instansiasi dari class referensinya seperti contoh berikut:

```javascript
class Employee {
    constructor (name, title, salary) {
        this.name = name;
        this.title = title;
        this.salary = salary;
    }
}

const andi = new Employee('Andi', 'manager', 8000000);
const budi = new Employee('Budi', 'staff', 4000000);
const carli = new Employee('Carli', 'staff', 4000000);
const dodi = new Employee('Dodi', 'staff', 4000000);
const emili = new Employee('Emili', 'staff', 4000000);
```

Pada kode di atas, saya membuat contoh class Employee dan membuat objek andi, budi, carli, dodi, dan emili. Dari beberapa objek tersebut dapat dikelompokkan menjadi manager dan staff. Apabila kita ingin mengubah gaji staff menjadi 5 juta maka kita harus mengubah gaji satu per satu pada saat instansiasi objek yang termasuk ke dalam staff. Untuk menghindari hal tersebut, kita dapat menggunakan factory method saat membuat objek agar lebih efisien. Berikut contoh kode pemrogramannya:

```javascript
class Employee {
    constructor (name, title, salary) {
        this.name = name;
        this.title = title;
        this.salary = salary;
    }
}

class EmployeeFactory {
    static createManager(name) {
        return new Employee(name, 'manager', 8000000);
    }

    static createStaff(name) {
        return new Employee(name, 'staff', 4000000);
    }
}

const andi = EmployeeFactory.createManager('Andi');
const budi = EmployeeFactory.createStaff('Budi');
const carli = EmployeeFactory.createStaff('Carli');
const dodi = EmployeeFactory.createStaff('Dodi');
const emili = EmployeeFactory.createStaff('Emili');
```

Di atas adalah contoh penggunaan factory method. Apabila kita akan mengubah gaji staff menjadi 5 juta, kita tinggal merubah method createStaff pada class EmployeeFactory.

Demikian yang dapat saya bagikan, apabila ada yang perlu dikoreksi silahkan share di kolom komentar. 😁
Day 22: absolutely nothing
Published: 2022-04-30 21:14:52

Hi!
can you believe that you can a spend a whole without doing anything? I know it's impossible but it happened to me today staying in bed for the whole before noon and watching things online for the whole afternoon. I was very tired and needed enough time to rest but I think there was a part of me that was procrastinating since I have a lot to do for this weekend. but as always no regrets it's ma rules and there should be no pressure 
I don't think tomorrow will be any different but I hope I will be motivated to take a walk at least it's been a while 
have peace
signing off...
Why pay attention to your clipping path?
Tags: clippingpath, transparentbackground, cutoutimage
Published: 2022-04-30 21:04:19

An image can have many external images in your image, so you have to select the [clipping path](https://toucheditingfast.com/services/clipping-path/) to keep an image. This is a very important contribution to remove your external background.

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

The importance of image must go a long way in advancing your e-commerce. So Touch Editing Fast is giving you all kinds of image benefits. Such as clipping paths, drop shades, image masking, background removal etc.
tooling basics
Published: 2022-04-30 20:50:58

for lab 1, the first thing I did was join the slack and download the oh my zsh. once I did that my terminal changed to this...
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rn2f6dyc035prr4la3d8.png).

I then moved on to download node js, npm, and open sea. I had no problems downloading these but I couldn't get yarn to work.

For the hello world I dowloaded the Lit elements and opened them into vs code and modified them a bit...
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/24rs6p79klr44b8g70ef.png) After this I was able to run it using num and everything worked great.
JSONPath with Alpine.js CSP build in Postman Visualizer
Tags: javascript, webdev, postman, json
Published: 2022-04-30 20:47:42

<p class="lead">Query JSON Response with JSON Path</p>


To work more easily with Postman JSON results, I implemented [JSONPath](https://goessner.net/articles/JsonPath/index.html#e3) in a [Postman Visualizer](https://learning.postman.com/docs/sending-requests/visualizer/#visualizer-api), to query the results.

JSONPath is to JSON what XPath is to XML, and it helps to get into large nested objects and find what you're looking for faster.

First I was using just a jQuery version that can be found in the examples and that worked just fine. ([JSONpath Visualizer | Postman Team Collections | Postman API Network](https://www.postman.com/postman/workspace/34f3a42c-18a7-4ad6-83fb-2c05767d63a7/request/1794236-b1c1129a-217b-4b47-8f7c-743dfd896dc4))

Then I thought this is a good opportunity of being a smart ass and implement it with [Alpine.js](https://alpinejs.dev/), and it was just a mess—but I found out a few things.

The biggest roadblock was finding out about Postman's Content-Security-Policy that can't be changed, and it doesn't allow JavaScript in HTML attributes, something that happens in Alpine, behind the scenes.

```
alpinejs:5 Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src http: https: 'unsafe-inline'".
```

There is more insight on how Postman deals with CSP here: https://community.postman.com/t/render-pdf-in-visualizer/9193/4 and in this video: https://youtu.be/6ajkO9JETDs?t=275 - the short version is, Postman creates a html file in the temp directory and this files comes with CSP meta tags, that can't be overwritten, so one is stuck with it.

Fortunately, Alpine.js offers a version that works in a more restrictive environment. That version is not on a CDN and I had to build it myself. This forced me to update all the Node and NPM stuff, which was a total mess,  but at the end, I got a working CSP version.

Of course, it's nicer to just link files from a CDN, so I created a gist and use https://raw.githack.com/ to serve the file from there.

[The whole gist](https://gist.github.com/marcus-at-localhost/dc19e9dd97743a1ef2fe039342e25b9e)

## How To:

Paste the following code into the "Test" area of Postman and fire up a call.

{% gist https://gist.github.com/marcus-at-localhost/dc19e9dd97743a1ef2fe039342e25b9e file=2postman-testing-script.js %}

[JSON Path with Alpine.js CSP build in Postman Visualizer by Marcus Obst](https://marcus-obst.de/blog/jsonpath-query-with-postman-vizualizer-and-alpinejs-csp-workaround)
Use interpolação e não concatenação
Tags: csharp
Published: 2022-04-30 20:43:10

Não use o operador aritmético de adição (+) para concatenar strings. A melhor prática é usar a interpolação. Veja os exemplos abaixo:

Exemplo utilizando a concatenação:
```csharp
string userName = "Alexandre";
string message = "Hello " + userName;
```

Exemplo utilizando a interpolação:
```csharp
string userName = "Alexandre";
string message = ($"Hello {userName}");
```
O símbolo $ no início da string indica que é uma string interpolada e que quaisquer expressões entre os caracteres { e } devem ser avaliadas e o resultado substituído em seu local.
A interpolação de string é mais eficiente do que usar o operador +. A concatenação de strings usando o operador + pode consumir muita memória devido à forma como as strings são tratadas pelas bibliotecas .NET. A interpolação de strings também é indiscutivelmente mais legível e menos propensa a erros.
Solve: Unable to enforce HTTPS for Github Pages Site
Tags: github, https, cloudflare, pages
Published: 2022-04-30 20:27:01

I recently changed the nameservers of my domain to Cloudflare. I then set up a Github pages site and followed the steps to use a custom domain for it.

I was facing an issue, wherein in Github pages settings I was unable to select the option to enforce HTTPS, with the following message:

> Unavailable for your site because your domain is not properly configured to support HTTPS

I checked the [help doc](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/troubleshooting-custom-domains-and-github-pages#https-errors) Github provided besides this error. I seemed to have configured the DNS records and other details correctly. I tried removing & then re-adding a custom domain to my Github pages site, but it didn't help.

Finally, through a conversation with Github help bot [here](https://support.github.com/request). I found the issue.
When we add a site on Cloudflare, by default it proxies the traffic to our site through their server. This is how it's able to offer us DDoS protection & other benefits. It turns out this was the issue which was causing the HTTPS certificate issuance that Github was trying to do (using LetsEncrypt) to fail.

> Cloudflare enables their HTTP/DNS proxy feature by default, meaning GitHub isn't able to see the DNS records required to generate an HTTPS certificate. You'll need to disable this for any DNS records that point towards GitHub.

Github bot recommended turning off proxying (Orange cloud) on those DNS records that pointed to Github and choosing DNS only (Grey cloud). Once, I did this, I then removed & re-added custom domain in Github pages settings to re-trigger certificate issuance, and it worked! Now HTTPS was enabled on my Github pages site & I was able to enforce HTTPS.


![Cloudflare DNS dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5sfswnclb2423orj65wx.png)

![Github pages Enforce HTTPS option](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/awznnsgzw6gf8eq3dppq.png)

Lastly, just adding a disclaimer the Github bot mentioned, to be mindful of this while taking these steps

> Disclaimer Disabling the HTTP/DNS proxy may interfere with other Cloudflare services. If you use other Cloudflare services with your site, we aren't able to guarantee that these will continue working. For more help with this, I'd recommend reaching out to Cloudflare's support team.
15 Essential GitHub Repos for Web Developers
Tags: github, programming, webdev
Published: 2022-04-30 19:26:23

[##  1. getify / You-Dont-Know-JS](https://github.com/getify/You-Dont-Know-JS)
A repo dedicated to the well-known You Don't Know JS book series by Kyle Simpson.



[## 2. sindresorhus / awesome](https://github.com/sindresorhus/awesome)
An ultimate list of resources for all kinds of developers. From JavaScript to Fortran and from Docker to Rails.



[## 3. EbookFoundation / free-programming-books](https://github.com/EbookFoundation/free-programming-books)
A giant list of completely free programming books in different languages.



[## 4. kamranahmedse / developer-roadmap](https://github.com/kamranahmedse/developer-roadmap)
Official repo of a roadmap.sh project. Highly recommend it for people who are only taking the first steps in IT.



[### 5. anuraghazra / github-readme-stats](https://github.com/anuraghazra/github-readme-stats)
A very useful repo in order to bring your GitHub Readme to the next level.



[### 6. jlevy/the-art-of-command-line](https://github.com/jlevy/the-art-of-command-line)
All you need for mastering the command line on one page.



[### 7. mbeaudru/modern-js-cheatsheet](https://github.com/mbeaudru/modern-js-cheatsheet)
A modern cheatsheet for the JavaScript knowledge you will frequently encounter in your projects.



[### 8. airbnb/javascript](https://github.com/airbnb/javascript)
JavaScript Style Guide from Airbnb. Also available on



[### 9. thedaviddias/Front-End-Checklist](https://github.com/thedaviddias/Front-End-Checklist)
An exhaustive list of all the elements you need to have before launching your website to production.



[### 10). ryanmcdermott/clean-code-javascript](https://github.com/ryanmcdermott/clean-code-javascript)
The must-know Clean Code principles adapted for the JavaScript world.



[### 11. bradtraversy/design-resources-for-developers](https://github.com/bradtraversy/design-resources-for-developers)
A curated and frequently updated collection of design resources for developers. Graphics, Fonts, Logos, Icons, you name it.



[### 12. trekhleb/javascript-algorithms](https://github.com/trekhleb/javascript-algorithms)
Algorithms and data structures implemented in JavaScript with explanations and links to further readings.



[### 13. microsoft/Web-Dev-For-Beginners](https://github.com/microsoft/Web-Dev-For-Beginners)
A 12-week, 24-lesson Web Dev curriculum made by Microsoft.



[### 14. sdmg15/Best-websites-a-programmer-should-visit](https://github.com/sdmg15/Best-websites-a-programmer-should-visit)
A truly impressive list of all kinds of websites every programmer should visit.



[### 15. FrontendMasters/learning-roadmap](https://github.com/FrontendMasters/learning-roadmap)
A broad learning roadmap from Frontend Masters.



**I hope you help me to continue uploading content**
https://www.buymeacoffee.com/digomicortU
Detecting Fake News with Python and Machine Learning.
Published: 2022-04-30 17:49:33

Hi :wave:! Nice to meet you devs :smile:. Here, we will talk about how we can use python to detect fake news. This article aims to walk you through the process of creating a machine learning model using python and NLP to successfully detect fake news.
You will need to know the fundamentals of Python, data structures and algorithms, python libraries such as Pandas, NumPy, and Methods in Data Analysis for example Passive Aggressive Classifiers.

#Key Terms
•	TfidfVectorizer
•	IDF (Inverse Document Frequency)
•	TF (Term Frequency)
•	Passive Aggressive Classifier

Preparing our dataset and work environment
First, we need to install a supported version of python. To do so, you can go to your browser and search ‘download python 3’ and then install after downloading. This will vary with the type of Operating system you will be using on your machine.
Dataset
Acquiring a suitable dataset presents one of the most crucial components of any data-science endeavor. These Data sets can be accessed on the Kaggle website.
#Coding
Now after installing python, the libraries, and the dataset too, it is time to launch our text editors (you can use Jupyter notebook) and begin importing the libraries you need. We can now view the first four records. Using Python, we can see that the data-set is divided into the following columns: id, title, author, text, and label. The features that are of interest to us are the label and text columns. The text column contains the contents of the article, whereas the label column represents whether the article is factual or not. This has been pre-made for us in binary form using ‘1’(‘REAL’) and ‘0’(‘FAKE’).
The PassiveAggressiveClassifier is to now be initialized in order to incorporate it into the model, we are going to use the “y_train” and “tfidf_train”.

>### Initialize the PassiveAggressiveClassifier and fit training sets
```
pa_classifier=PassiveAggressiveClassifier(max_iter=50)
pa_classifier.fit (tfidf_train, y_train)
```
Finally, using the vectorizer you can predict whether an article is reliable or not and we are going to calculate our model’s accuracy.

>### Predict and calculate accuracy
```
y_pred=pa_classifier.predict(tfidf_test)
score=accuracy_score(y_test, y_pred)
print(f'Accuracy: {round(score*100,2)} %')
```

You can now see the accuracy the model had while conducting its tests. Although you view the accuracy, you might not know the number of successful predictions and failures. In order to access such information, you can use a confusion matrix and draw conclusions. This can be easily done by:

>### Build confusion matrix
```confusion_matrix(y_test, y_pred, labels=['FAKE','REAL'])```

#Conclusion.
It is essential that such models are further advanced in order to effectively combat misinformation in these difficult times.
I get err MongoInvalidArgumentError: Collection name must be a String
Tags: nextjs, react, help
Published: 2022-04-30 18:49:49

I get err MongoInvalidArgumentError: Collection name must be a String

First function:
```
export default function Questions ({data})
 {const [collection, setCollection] = useState("")
```
Second function:

```
export async function getServerSideProps({collection} ) 
{const client = await clientPromise;const db = client.db("javascript_questions");

let data = await db.collection(collection).find({}).toArray();
data = JSON.parse(JSON.stringify(data));
return {props: { data },  };}
```
The Captain's Room | Hackerrank Problem Solution With Explanation
Tags: python, hackerrank, competitveprogramming, algorithms
Published: 2022-04-30 18:43:50

## Problem Statement
Mr. Anant Asankhya is the manager at the INFINITE hotel. The hotel has an infinite amount of rooms.

One fine day, a finite number of tourists come to stay at the hotel.
The tourists consist of:
→ A Captain.
→ An unknown group of families consisting of  members per group where **K ≠ 1**.

The Captain was given a separate room, and the rest were given one room per group.

Mr. Anant has an unordered list of randomly arranged room entries. The list consists of the room numbers for all of the tourists. The room numbers will appear **K** times per group except for the Captain's room.

Mr. Anant needs you to help him find the Captain's room number.
The total number of tourists or the total number of groups of families is not known to you.
You only know the value of **K** and the room number list.

**Input Format**
The first line consists of an integer, **K**, the size of each group.
The second line contains the unordered elements of the room number list.

**Output Format**
Output the Captain's room number.

**Sample Input**
5
1 2 3 6 5 4 4 2 5 3 6 1 6 5 3 2 4 1 2 5 1 4 3 6 8 4 3 1 5 6 2 

**Sample Output**
8

**_Link to question:_** [https://www.hackerrank.com/challenges/py-the-captains-room/problem](https://www.hackerrank.com/challenges/py-the-captains-room/problem)

## Solution (Python3)

```
if __name__ == '__main__':
    k = int(input())
    rooms = list(map(int, input().split()))
    roomSet = set(rooms)
    roomSum = sum(rooms)
    roomSetSum = sum(roomSet) * k
    captiansRoom = (roomSetSum - roomSum) // (k - 1)
    print(captiansRoom)

```

## Explanation
The logic behind this is simple mathematics. If all the unique elements were present in the array **K** times then their sum would have been **sum of unique elements mutliplied K times**. But there is one unique element that is present only one time. So the **roomSetSum** variable's value will be  more than the actual sum of elements of the given array, let's say it **x**.

If we see it from a different angle then we will find that our desired element, let's say it **z** is present only one time but is missing **k-1** times from the array. So we can conclude that **x** is nothing but **z** multiplied by **k-1**. Now all we've to do is to do reverse engineering and just find the **x** _(that is the difference between the sum of all the elements of rooms array if it contained all the unique elements exactly **k** times and actual sum of all the elements of the rooms array, i.e. the array that contains all the elements **k** times but a single element only one time)_ and divide it with **k-1** and voila! We got the answer.
netooze - Simpler cloud. Happier devs. Better results
Tags: cloudcomputing, webhosting, virtualization, webdev
Published: 2022-04-30 18:03:13

Netooze provides a simple cloud platform to deploy, manage, and scale applications of any size, removing infrastructure friction and providing predictability so startups, IT teams, developers, and SysAdmins can spend more time building better software. vStack cloud servers start under $5/mo. Deploy in under 55 seconds.

https://www.netooze.com
Why is BERT so powerful?
Tags: nlp, ai, deeplearning
Published: 2022-04-30 18:01:22

BERT is a very recent introduction that has provided us the-state-of-art results in many NLP tasks Published by researchers at Google AI language; its main outline is creating a bi-directional training of a transformer. When trained bi-directionally, the model has a deeper sense of the context of the language.

What is the necessity of BERT?
The most challenging aspect of any NLP problem is the deficit of training data. Despite the availability of enormous training data in general if we want to categorize the training set into task-specific datasets, we need to segregate them into many sub-categories. After this segregation, we end up with only a few hundred thousand odd human-labeled training datasets. Unfortunately, the Deep Learning based NLP tasks; require a much higher amount and can only have a significant accuracy or represent improvement only when trained with an enormous dataset.

To overcome this shortcoming, researchers and scholars have come up with techniques for general-purpose language representation with the help of unannotated text available on the web (pre-training). These models can then be fine-tuned for smaller task-specific datasets. This method significantly increases the accuracy when compared to the model trained on a small dataset for task-specific from the scratch, thus drastically reducing the training data that we usually require.

Why is BERT so powerful?
The BERT rather than predicting the next word in the sequence masks a finite percent of words within the sequence randomly and tries to predict them. This is termed Masked LM (MLM). The reason why the BERT model is powerful is because instead of predicting the subsequent word in the sequence, the model accounts for all words in the sequence and comes up with a deeper understanding of the context. To explain it more clearly, the usage of words in any language for that matter depends entirely on the context:

Let’s say we have two sentences: he is an avid book reader, and he went to book movie tickets along with his friend. In the two sentences, the word book incorporates a different meaning based on the context in which the word is used. BERT analyses and learns this contextual meaning to differentiate between the same words used in different locations.

Hope this was helpful.