teleren/devto huggingface dataset:
Different ways of making REST Endpoint inference with Sagemaker SDK
Tags: aws, sagemaker, machinelearning, rest
Published: 2022-05-02 04:35:50

In this article we are going to see two ways of making inference from a machine learning model endpoint using Sagemaker SDK. The machine learning model is trained on 'Amazon Customer Reviews Dataset' and can predict customer review rating on a scale of 1-5. As a part of transfer learning, I have used BERT model with pre-training carried out through DistilBERT, using Hugging face transformer, which provides bi-directional attention, and TensorFlow. Details regarding model implementation are shown below. 

![High-level ML model details](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a33nn5ht66w13oocut9p.png)
 
The first step for the inference script is to include the boiler plate details like session, bucket, role, region, account ID and Sagemaker object. 

![Boiler plate Sagemaker setup code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tb2ed8mluwyhxqt96hyt.png)

The second step is to include the details completed during the model deployment stage. This will include the training job name, model name, and endpoint details. 

![Retrieving model endpoint](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gnrfqwq4s0lxwuk4uq9m.png)


Using the deployment stage details, a predictor object needs to be created which includes session details and the endpoint name. We are using JSONserializer and JSONdeserializer to format the input, interpret it and then deserialize it into an object type. 

![Creating predictor object](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3mgz8ydgw5qkn60ec2yi.png)

Category 1: Real-time/Ad-hoc predictions 
Once this predictor is created, it can be used to make ad-hoc predictions by providing inputs as features, shown below. Here function predictor.predict() is being used to make real-time predictions against Sagemaker endpoints with python objects. Four examples of Amazon reviews have been shown here. 

![Real-time predictions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t7t9bs32vfceh2uaq5hr.png)
 

Category 2: Batch predictions
The reviews are stored in a .tsv file (tab separated value) and can be processed all at once. Predictions of 1000 sample reviews out of 102,084 reviews, were made which had a duration of 5 mins 45 seconds based on the compute being used. By providing the argument of 10, on the df_sample_reviews.head() call, we can retrieve the small number and validate the predictions. The column which serves as an input is 'review body' and predictions are compared against 'star rating'. 

![Batch predictions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/op0a725lm27zki5hdhpb.png)
 
Predictions can also be invoked model as a SageMaker Endpoint directly using the following HTTP request/response syntax. This approach is primarily being used when models are deployed as microservices in a production environment. 

References: 
- Data Science on AWS, Chris Fregly and Antje Barth
- https://docs.aws.amazon.com/index.html?nc2=h_ql_doc_do_v
- https://sagemaker.readthedocs.io/en/stable/
Full stack software engineer
Tags: javascript, webdev, beginners, programming
Published: 2022-05-02 04:13:14

“A full-stack engineer is a software developer that’s writing code not only for the user’s front-end web applications or mobile applications, but they’re also writing API code that sits in the middle, they’re writing server code that sits in the back, and they’re also connecting and communicating with databases.”

let me get this straight

## if you know these languages and technologies it will be easy to become a Full stack software engineer.

Currently, the most popular languages for full stack developers are Node.js, Python, C#. ASP.NET, and PHP. It’s believed that the most common languages for full stack developers in future will be HTML/CSS, and some of the newer ones like AngularJS, Node.js, React.js and so on.

apart from that JAVA,SPRING FRAMEWORK WITH HIBERNATE also much helpful.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/geefde861yvmtlsh66qi.jpg)
Experimenting with API microservices
Tags: webdev, beginners, microservices, api
Published: 2022-05-02 03:58:54

## Adding Wikipedia's API to my project
Wikipedia is a monolith in terms of knowledge of almost any subject. In my recent project, a user's location is displayed via Google Maps based off their IP address using [Free Geo IP](https://freegeoip.app/).

Since we are able to determine a user's city and state already, the project has expanded to incorporate [**wikipedia-query source**](wikipedia-query source). This web-component calls the Wikipedia API, receives JSON data back and is able to display information about a user's city or state.

## Install/Setup

1. Wikipedia-query needs to be added as a dependency in package.json. 
![dependency](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mabopdul69ivyh2phma2.png)
2. Import into the project: `import '@lrnwebcomponents/wikipedia-query';`

## Usage of location

```
//finding wiki based on city and state
<wikipedia-query search="${this.city}, ${this.state}"></wikipedia-query>

//finding wiki based on city
<wikipedia-query search="${this.city}"></wikipedia-query>

//finding wiki based on state
<wikipedia-query search="${this.state}"></wikipedia-query>
```
Wikipedia-query can display more than location information and can be included in your project today. Please visit [wikipedia-query documentation](https://github.com/elmsln/lrnwebcomponents/blob/master/elements/wikipedia-query/src/wikipedia-query.js#L82) and [Wikipedia Offical API documentation](https://en.wikipedia.org/w/api.php)
Vercel
Published: 2022-05-02 03:54:22

what is Vercel?
Vercel is a programing tool that is used for building and deploying projects. it is a cloud computing service that can be used free but cost money for a premium membership.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w45otgakarui70ytnciy.png)
You can link it directly to GitHub to use it for git projects.

once you have a project selected and loaded it Vercel does the rest and deploys the entirety of your project for you.
Medusa images uploading using Imgur API
Tags: medusa, imgur, promise, javascript
Published: 2022-05-02 03:51:23


[Medusa](https://github.com/medusajs/medusa) is very powerful, useful, open-source and easily-revised e-commerce project. 

But in default, it doesn't provide any kind free online space to store products' pictures. The offical documents describe how to use [digitalOcean](https://docs.medusajs.com/how-to/uploading-images-to-spaces/) and [AWS S3](https://docs.medusajs.com/how-to/uploading-images-to-s3/) to put your uploaded images of products but those services are used with paid. 

Eventually, I found one way to use [Imgur](https://imgur.com/) API to store our images for free totally. Following are the steps you can go with.

1. create imgur account then go to its [settings page](https://imgur.com/account/settings/apps). It will list client id and secrets key of apps as below capture.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zsoojlnflotzn2ooc4l5.png)
If you don't have any apps yet, [create one](https://api.imgur.com/oauth2/addclient).
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l7jbbkknr7w0175cswdg.png)
 
2. Declare the headers and create an promise image upload function to call [imgur API](https://apidocs.imgur.com/#c85c9dfc-7487-4de2-9ecd-66f727cf3139)(https://api.imgur.com/3/image). (request.js in [src/services](https://github.com/medusajs/admin/blob/master/src/services/request.js))

```
const headers = {
  "Content-Type": "multipart/form-data",
  Authorization: "Client-ID " + IMGUR_CLIENT_ID,
}
```
```
export const imgurUploadPromise = (formData) => {
  const apiUrl = "https://api.imgur.com/3/image"
  return axios
    .post(apiUrl, formData, {
      headers,
    })
    .then((res) => {
      console.log(res)
      return res.data.data.link
    })
    .catch((err) => console.log(err))
}
```
Make sure the link of response format should be _res.data.data.link_. 

3. Using promise.all to upload multiple images in one operation. (api.js in [src/services](https://github.com/medusajs/admin/blob/master/src/services/api.js))
```
  uploads: {
    create(files) {
      const promiseArray = []
      for (const f of files) {
        const formData = new FormData()
        formData.append("image", f)
        promiseArray.push(imgurUploadPromise(formData))
      }

      return Promise.all(promiseArray).then((values) => {
        const uploads = values.map((value) => {
          return { url: value }
        })
        return {
          data: {
            uploads,
          },
        }
      })
    },
```
Remember the return data format must be _{ url: value }_ for each promise and return _data: { uploads }_ for all.

Then it will be done successfully. (don't upload images each over than [5MB](https://help.imgur.com/hc/en-us/articles/115000083326-What-files-can-I-upload-Is-there-a-size-limit-#:~:text=The%20maximum%20file%20size%20for,will%20be%20converted%20to%20JPEGs.&text=Non%2Danimated%20images%20over%201MB,holders%20will%20be%20lossily%20compressed.))
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zqmim6zjthhj7pu9z1z8.png)
Terminal Trouble
Published: 2022-05-02 03:33:45

##The Issue 
So I recently did an update on my Macbook to the macOS 12.3. If you are anything like me. We usually just run the update without looking into what the update includes and what it will effect. 🤷🏿🤷🏿🤷🏿

Welp...*lesson learned* 

The new update effectively removed the ability to open files in VScode via the `code .` in the terminal and again if your anything like me that's not going to fly. 

## The Fix 
When I first came across this issue. I though I was doing something wrong. So I rebooted my Macbook, checked my spelling and a host of others thing before I decided to Google it. (Google is out friend). 

It turns out that with this update apple removed it's support of python 2 🙄 and python 3 doesn't come with Mac which causes the `code .` command to not work anymore. 

🤔🤔 Now what? After doing some research ...aka Googling. 
I came across this fix. 

To open a file from the terminal use the keyword "open" and the file path/name. 

To open a VScode file follow these steps 
1) cd /usr/local/bin
2) nano code
3) change python => python3 on the following line

**Make sure you have the shell command code set up in VScode**

I hope this helps and if you come across any other fixes or tips for this issue please feel free to leave them in the comments 

As always Happy Coding 👨🏿‍💻👨🏻‍💻🧑🏾‍💻👩‍💻
Month 5 of my Coding Journey
Tags: beginners, programming, devjournal, javascript
Published: 2022-05-02 03:31:29

Hello Dev community,

Just thought I'd give an update on my journey thus far.

For the past two weeks during my [4th month](https://dev.to/taepal467/month-4-of-my-coding-journey-1clc) of learning to code, I will admit that I have been slacking. I did not accomplish as much as I'd like to. But I did  complete the frontendmentor [project](https://github.com/taepal467/Huddle_landing_page_with_curvedSections). The live site is [here](https://taepal467.github.io/Huddle_landing_page_with_curvedSections/). For this challenge, I mainly focused on mobile-first workflow. Although not perfect, it's still an improvement compared to the other projects I've completed. I still need to work on my mobile-first skills as well as learning how to get the web page to be displayed the same in different browsers.

I also learned about Sass. I actually like it and it's not too complicated to understand. But still need to practice using it in real world projects.

## My goals for May
This month, I will be doing things a bit differently. I will begin building my portfolio and start preparing myself so I can start applying for work (however long that will take). I will look up web developer interview questions and start practicing and preparing. I will also need to continue practicing working with JavaScript in projects. So that is what I will do **after** I've completed my portfolio. I don't want to overwhelm myself by doing too many things at once. After I've completed my portfolio, I will go back to completing frontendmentor projects and of course using JavaScript. This month, I also want to code longer hours. Usually I code for about 2-3 hours a day. But that's nothing compared to an 8 hour shift 5 days a week. My goal is to code for about 5-6 hours a day. Wish me luck guys!🤞🏾

> "Nature does not hurry, yet everything is accomplished" -Lao Tau
Vercel Deployment explained
Tags: vercel, webdev, beginners, webcomponents
Published: 2022-05-02 03:27:20

## Vercel who?
Vercel is designed to increase developer efficiency. Allowing teams to develop, preview and ship static sites on the fly. Built with performance in mind, Vercel deploys instantly and scales automatically.


## Vercel Quickstart
Vercel developed their own [CLI](https://vercel.com/cli), however I found it easier to use their [website](https://vercel.com/). You'll want to start by creating your own account or by signing up through GitHub.

After you have created an account, create a new project.
![New Project Button](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h5hjyx7tb2j3sff93fj3.png)
Then, connect Vercel to your GitHub account and import the repository you'd like to deploy.
![Import repo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hw45ty4qwzjdmd81monu.png)
In this guide, I forked my repo from [here](https://github.com/btopro/ist-vercel-demo). Also, feel free to view my [repo](https://github.com/mnmartinelli/ist-vercel-demo)


## Build & Development Settings
Please save and change your settings to the following:
- **Build Command** change setting to `npm run-script build`
- **Output Directory** change setting to: `dist`
- **Install Command** change setting to: `npm install`
![Build settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pndaq9nb33drgkr4g8zc.png)
 

## Additional Settings:
Vercel has many features for developers to take advantage of, including: Environment variables, Integrations, logs, analytics, and Severless functions (premium feature).
If you would like to learn more, please visit the official [documentation](https://vercel.com/docs)


## Time to Deploy
Press the Deploy button and you'll all finished! Congratulations on deploying with Vercel. If you run into any issues, be sure to check the build log.
Day 2 - Differences between checked & unchecked exceptions in java!
Tags: java, beginners
Published: 2022-05-02 03:40:29

---
title: Day 2 - Differences between checked & unchecked exceptions in java!
published: true
date: 2022-05-02 03:19:46 UTC
tags: #java,#beginners
canonical_url: https://blog.sanjaybabu.dev/day-2-exceptions-java
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/npbehboq9gok7dfaeinu.jpg
series : 100 days of interview questions
---

## Checked Exceptions

These are checked during compile time itself. Checked Exceptions should be either handled or the same should be notified with the throws keyword.

Example - SQLException, IOException.

## Unchecked Exceptions

These exceptions are checked during runtime. The classes that inherit the RuntimeException fall under unchecked exceptions. It's not necessary to handle these exceptions.

Example - NullPointerException, ArrayIndexOutOfBoundsException.
Laravel Authentication Using Breeze
Tags: laravel, authentication, php, beginners
Published: 2022-05-02 03:11:27

In this tutorial, we will show you new information about laravel authentication using breeze. Laravel breeze is a simple implementation of all laravel authentication including login, registration, email verification, password reset, and password confirmation. Laravel breeze is powered by blade templates and Tailwind CSS.

It publishes authentication controllers, views, and routes to your application that can be easily customized based on your own application’s needs. laravel login and registration using laravel breeze kits automatically scaffold your application with the routes, controllers, and views you need to register and authenticate your application's users.

So, let's see laravel authentication with breeze example, login, and registration using laravel 8 breeze, laravel 8 authentication using breeze example.

---

> **_[Read More : Laravel Authentication Using Breeze](https://techsolutionstuff.com/post/laravel-authentication-using-breeze)_**
Using Docker
Published: 2022-05-02 02:50:29

## What is Docker?
Docker is a web container tool used for developing deploying, testing, and controlling containers. the tool is extremely powerful and even allows two containers to run from the same host.

## Using Docker

Getting started with docker is as simple as downloading the desktop app, or playing with the tutorial labs on their website. Once the app is downloaded you can run the command `docker run -dp 80:80 docker/getting-started as shown below, ` then go to your local host in your browser.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4p691libmhalj5gb9w9o.png)You can see the recent containers in the docker desktop app.

to be able to integrate the nasa project into docker I had to create a new instance and docker somewhat automatically creates the file setup for you. to run the program you can use `dockercompose up`.
Axios some info
Tags: javascript, webdev, axios, xmlhttprequest
Published: 2022-05-02 02:32:53

## What is axios?

Axios is a promise base HTTP client for node.js. On the server it uses the native node `http` module while on the client side it uses XMLHttpRequest system.

Using whatever package manager you like add `axios` to your list of dependencies and install.

To make a GET request some boilerplate is required in the file the request is made.

```JavaScript
const axios = require('axios');

axios.get('/user', {
  params: {
    id: 1,
  }
})
  .then(response => {
 console.log(response);
  // do more with response
});
.catch(error => {
  console.error(error);
  // handle error
});
```

POST requests are made in a similar fashion:

```JavaScript
axios.post('/user', {
  firstName: 'Bob',
  lastName: 'Ross'
})
.then(response => {
  // handle response
})
.catch(error => {
  // handle error
});
```

It is possible to use a single boilerplate for both GET and POST requests within a single function:

```JavaScript
const request = (var) => {
  const options = {
    method: "VERB",
    url: "API-ENDPOINT",
    params: { `${var}` },
    headers: {
      "API-HOST": "HOST-NAME",
      "API-KEY": "KEY-VALUE",
    },
  },

  axios.request(options)
  .then(response => {
    // handle response
  })
  .catch(error => {
    // handle error
  });
};
```

Axios allows for easy client-side requests this way and will offer protection against Cross-site Request Forgery as well.
Days 21 - 40: #100DaysofCode
Tags: 100daysofcode, ux, design
Published: 2022-05-02 02:32:42

This section of the #100daysofcode was more focused on UX/UI principles and color theory. I read and researched about many ways to incorporate different colors, typography, white space, and shapes in order to correctly represent the brand I imagined in my head.

Then it was maintaining consistency throughout products from business cards, pamphlets, PowerPoints, and others that came to mind. After all, when you're creating an application or website, it is never one single entity that you need to produce. My head was jumbled with what to do next, as always.

Since there needed to be a consistency between products while still offering a breathe of fresh air between each design, I continued to research ways to design responsive elements. It was a very exciting couple weeks seeing this brand come to life right before my eyes.

Sadly, this project has come to a halt. But nonetheless, it was a great learning opportunity through all the research I did. I can't wait to take everything I learned to the next project I invest in.

Happy coding!
Naves do Conhecimento abrem inscrição para cursos gratuitos de tecnologia, informática e empreendedorismo.
Tags: cursogratuito, ccna, cursos, cursosgratuitos
Published: 2022-05-05 23:44:14

---
title: Naves do Conhecimento abrem inscrição para cursos gratuitos de tecnologia, informática e empreendedorismo.
published: true
date: 2022-05-02 02:18:10 UTC
tags: CursoGratuito,ccna,cursos,cursosgratuitos
canonical_url: 
---

As Naves do Conhecimento estão com inscrições abertas para mais 13 mil vagas em diversos cursos gratuitos nas áreas de tecnologia, informática e empreendedorismo, no Rio. Os cursos serão realizados no formato presencial e online. Palestras e oficinas gratuitas também estão disponíveis na programação oferecida no mês de maio.

Inscrições presenciais acontecem somente nas naves do Engenhão (Engenho de Dentro), Madureira, Triagem e Nova Brasília (Bonsucesso), na Zona Norte. As vagas são limitadas.

Ao final do curso os alunos recebem seu certificado de conclusão. Para ter acesso ao cronograma e fazer a inscrição, basta acessar o site da Nave do Conhecimento.

Entre os muitos temas oferecidos pelas Naves estão:

- Operador de Computador
- Informática Básica
- Informática Kids
- Informática Senior
- Construindo o E-commerce
- Canva: Design para seu Empreendimento
- Introdução a Redes de Computadores
- Excel para Ambiente Empresarial
- DashBoard: Criando uma apresentação de dados
- Introdução ao Python
- Excel para iniciantes
- Introdução ao Marketing Digital
- Edição de Vídeo com Lightworks
- Analista em Help Desk
- Lógica de Programação
- Mobgrafia: Fotografia com Celular
- Operação e Gerenciamento de Redes: CCNA
- Programação para Crianças: Scratch
- Gestão de Compras e Estoque
- Fotografia em Estúdio
- Fotografia para Produto
- Criação de Currículo

**Cursos:** Presenciais (Rio de Janeiro) e EAD (Brasil)

**Site Nave do Conhecimento:** [https://capacitacao.navedoconhecimento.rio/](https://capacitacao.navedoconhecimento.rio/)

**Fonte:** [https://g1.globo.com/rj/rio-de-janeiro/noticia/2022/04/27/naves-do-conhecimento-abrem-inscricao-para-cursos-gratuitos-de-tecnologia-informatica-e-empreendedorismo.ghtml](https://g1.globo.com/rj/rio-de-janeiro/noticia/2022/04/27/naves-do-conhecimento-abrem-inscricao-para-cursos-gratuitos-de-tecnologia-informatica-e-empreendedorismo.ghtml)

O post [Naves do Conhecimento abrem inscrição para cursos gratuitos de tecnologia, informática e empreendedorismo.](https://guiadeti.com.br/naves-do-conhecimento-abrem-inscricao-para-cursos-gratuitos-de-tecnologia-informatica-e-empreendedorismo/) apareceu primeiro em [Guia de TI](https://guiadeti.com.br).
Find the RGB value of any color on the screen in OSX quickly and easily
Tags: osx, color, finder, rgb
Published: 2022-05-02 02:08:22

I found myself today wanting to retrieve a color from an image. This normally involves opening the image in some sort of image editing software and using a tool called the eyedropper. It's a multi-step process and kind of a pain.

So I wondered, is there an easier way? It turns out that on Apple computers there is a built in tool called **Digital Color Meter** that is included in the Apps/Utilities in OSX.

It tracks your cursor and displays the RGB value of that pixel or pixels on a little window. Useful for emulating a cool color when trying to create something!

![Digital Color Meter](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d49oswvqtu7o0ej060uy.png)

You can also easily copy the RGBs as a string using the keycombo ⇧ + ⌘ + C


![Keyboard Shortcuts](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zoel7kpeoladao2g7dkp.png)